Changer les degats des poings

  • Initiateur de la discussion
  • Banni
lampoule

lampoule

Psychopathe
Messages
1 016
Score réaction
332
Points
300
Bonjour j'aimerais baisser les degats des poing sur mon serv que sa fasse entre 2 et 4 de degats
Comment faire ?

(C'est les poings de base )
 
Yoh Sambre ♪

Yoh Sambre ♪

Shaman Fou
Messages
16 293
Score réaction
9 688
Points
1 845
lampoule à dit:
Bonjour j'aimerais baisser les degats des poing sur mon serv que sa fasse entre 2 et 4 de degats
Comment faire ?

(C'est les poings de base )
J'avais envoyé a skydrazz a un moment exactement la même chose si personne ne te le donne je te fait ça dans l'aprem c'est vraiment 3 fois rien ;)
 
  • Initiateur de la discussion
  • Banni
lampoule

lampoule

Psychopathe
Messages
1 016
Score réaction
332
Points
300
Yoh Sambre ♪ à dit:
J'avais envoyé a skydrazz a un moment exactement la même chose si personne ne te le donne je te fait ça dans l'aprem c'est vraiment 3 fois rien ;)
Ha ok merci beaucoup :) si j'ammais ta le temps viens sur mon ts ou quoid comme sa tu m'aprend sa m'interesse :)

Ts.springcity.fr dispo vers 18h30
 
Yoh Sambre ♪

Yoh Sambre ♪

Shaman Fou
Messages
16 293
Score réaction
9 688
Points
1 845
lampoule à dit:
Ha ok merci beaucoup :) si j'ammais ta le temps viens sur mon ts ou quoid comme sa tu m'aprend sa m'interesse :)

Ts.springcity.fr dispo vers 18h30
Je ne vais pas sur TS ,

bref

garrysmod/lua/weapons

edit le fichier 'weapon_fists.lua' > efface la totalité & C/C ceci a la place

Code:
AddCSLuaFile()
SWEP.PrintName = "Vos Poings"
SWEP.Author = "Kilburn, robotboy655, MaxOfS2D & Tenrys"
SWEP.Purpose = ""
SWEP.Slot = 0
SWEP.SlotPos = 4
SWEP.Spawnable = true
SWEP.ViewModel = Model( "models/weapons/c_arms.mdl" )
SWEP.WorldModel = ""
SWEP.ViewModelFOV = 54
SWEP.UseHands = true
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = true
SWEP.Secondary.Ammo = "none"
SWEP.DrawAmmo = false
SWEP.HitDistance = 45
local SwingSound = Sound( "WeaponFrag.Throw" )
local HitSound = Sound( "Flesh.ImpactHard" )
function SWEP:Initialize() self:SetHoldType( "fist" )
end
function SWEP:SetupDataTables() self:NetworkVar( "Float", 0, "NextMeleeAttack" ) self:NetworkVar( "Float", 1, "NextIdle" ) self:NetworkVar( "Int", 2, "Combo" )
end
function SWEP:UpdateNextIdle() local vm = self.Owner:GetViewModel() self:SetNextIdle( CurTime() + vm:SequenceDuration() / vm:GetPlaybackRate() )
end
function SWEP:PrimaryAttack( right ) self.Owner:SetAnimation( PLAYER_ATTACK1 ) local anim = "fists_left" if ( right ) then anim = "fists_right" end if ( self:GetCombo() >= 2 ) then anim = "fists_uppercut" end local vm = self.Owner:GetViewModel() vm:SendViewModelMatchingSequence( vm:LookupSequence( anim ) ) self:EmitSound( SwingSound ) self:UpdateNextIdle() self:SetNextMeleeAttack( CurTime() + 0.2 ) self:SetNextPrimaryFire( CurTime() + 0.9 ) self:SetNextSecondaryFire( CurTime() + 0.9 )
end
function SWEP:SecondaryAttack() self:PrimaryAttack( true )
end
function SWEP:DealDamage() local anim = self:GetSequenceName(self.Owner:GetViewModel():GetSequence()) self.Owner:LagCompensation( true ) local tr = util.TraceLine( { start = self.Owner:GetShootPos(), endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance, filter = self.Owner, mask = MASK_SHOT_HULL } ) if ( !IsValid( tr.Entity ) ) then tr = util.TraceHull( { start = self.Owner:GetShootPos(), endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance, filter = self.Owner, mins = Vector( -10, -10, -8 ), maxs = Vector( 10, 10, 8 ), mask = MASK_SHOT_HULL } ) end -- We need the second part for single player because SWEP:Think is ran shared in SP if ( tr.Hit && !( game.SinglePlayer() && CLIENT ) ) then self:EmitSound( HitSound ) end local hit = false if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) then local dmginfo = DamageInfo() local attacker = self.Owner if ( !IsValid( attacker ) ) then attacker = self end dmginfo:SetAttacker( attacker ) dmginfo:SetInflictor( self ) dmginfo:SetDamage( math.random( 2, 4 ) ) if ( anim == "fists_left" ) then dmginfo:SetDamageForce( self.Owner:GetRight() * 4912 + self.Owner:GetForward() * 9998 ) -- Yes we need those specific numbers elseif ( anim == "fists_right" ) then dmginfo:SetDamageForce( self.Owner:GetRight() * -4912 + self.Owner:GetForward() * 9989 ) elseif ( anim == "fists_uppercut" ) then dmginfo:SetDamageForce( self.Owner:GetUp() * 5158 + self.Owner:GetForward() * 10012 ) dmginfo:SetDamage( math.random( 2, 4 ) ) end tr.Entity:TakeDamageInfo( dmginfo ) hit = true end if ( SERVER && IsValid( tr.Entity ) ) then local phys = tr.Entity:GetPhysicsObject() if ( IsValid( phys ) ) then phys:ApplyForceOffset( self.Owner:GetAimVector() * 80 * phys:GetMass(), tr.HitPos ) end end if ( SERVER ) then if ( hit && anim != "fists_uppercut" ) then self:SetCombo( self:GetCombo() + 1 ) else self:SetCombo( 0 ) end end self.Owner:LagCompensation( false )
end
function SWEP:OnDrop() self:Remove() -- You can't drop fists
end
function SWEP:Deploy() local speed = GetConVarNumber( "sv_defaultdeployspeed" ) local vm = self.Owner:GetViewModel() vm:SendViewModelMatchingSequence( vm:LookupSequence( "fists_draw" ) ) vm:SetPlaybackRate( speed ) self:SetNextPrimaryFire( CurTime() + vm:SequenceDuration() / speed ) self:SetNextSecondaryFire( CurTime() + vm:SequenceDuration() / speed ) self:UpdateNextIdle() if ( SERVER ) then self:SetCombo( 0 ) end return true
end
function SWEP:Think() local vm = self.Owner:GetViewModel() local curtime = CurTime() local idletime = self:GetNextIdle() if ( idletime > 0 && CurTime() > idletime ) then vm:SendViewModelMatchingSequence( vm:LookupSequence( "fists_idle_0" .. math.random( 1, 2 ) ) ) self:UpdateNextIdle() end local meleetime = self:GetNextMeleeAttack() if ( meleetime > 0 && CurTime() > meleetime ) then self:DealDamage() self:SetNextMeleeAttack( 0 ) end if ( SERVER && CurTime() > self:GetNextPrimaryFire() + 0.1 ) then self:SetCombo( 0 ) end
end
 
  • J'aime
Réactions: Taink
  • Initiateur de la discussion
  • Banni
lampoule

lampoule

Psychopathe
Messages
1 016
Score réaction
332
Points
300
Yoh Sambre ♪ à dit:
Je ne vais pas sur TS ,

bref

garrysmod/lua/weapons

edit le fichier 'weapon_fists.lua' > efface la totalité & C/C ceci a la place

Code:
AddCSLuaFile()
SWEP.PrintName = "Vos Poings"
SWEP.Author = "Kilburn, robotboy655, MaxOfS2D & Tenrys"
SWEP.Purpose = ""
SWEP.Slot = 0
SWEP.SlotPos = 4
SWEP.Spawnable = true
SWEP.ViewModel = Model( "models/weapons/c_arms.mdl" )
SWEP.WorldModel = ""
SWEP.ViewModelFOV = 54
SWEP.UseHands = true
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = true
SWEP.Secondary.Ammo = "none"
SWEP.DrawAmmo = false
SWEP.HitDistance = 45
local SwingSound = Sound( "WeaponFrag.Throw" )
local HitSound = Sound( "Flesh.ImpactHard" )
function SWEP:Initialize() self:SetHoldType( "fist" )
end
function SWEP:SetupDataTables() self:NetworkVar( "Float", 0, "NextMeleeAttack" ) self:NetworkVar( "Float", 1, "NextIdle" ) self:NetworkVar( "Int", 2, "Combo" )
end
function SWEP:UpdateNextIdle() local vm = self.Owner:GetViewModel() self:SetNextIdle( CurTime() + vm:SequenceDuration() / vm:GetPlaybackRate() )
end
function SWEP:PrimaryAttack( right ) self.Owner:SetAnimation( PLAYER_ATTACK1 ) local anim = "fists_left" if ( right ) then anim = "fists_right" end if ( self:GetCombo() >= 2 ) then anim = "fists_uppercut" end local vm = self.Owner:GetViewModel() vm:SendViewModelMatchingSequence( vm:LookupSequence( anim ) ) self:EmitSound( SwingSound ) self:UpdateNextIdle() self:SetNextMeleeAttack( CurTime() + 0.2 ) self:SetNextPrimaryFire( CurTime() + 0.9 ) self:SetNextSecondaryFire( CurTime() + 0.9 )
end
function SWEP:SecondaryAttack() self:PrimaryAttack( true )
end
function SWEP:DealDamage() local anim = self:GetSequenceName(self.Owner:GetViewModel():GetSequence()) self.Owner:LagCompensation( true ) local tr = util.TraceLine( { start = self.Owner:GetShootPos(), endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance, filter = self.Owner, mask = MASK_SHOT_HULL } ) if ( !IsValid( tr.Entity ) ) then tr = util.TraceHull( { start = self.Owner:GetShootPos(), endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.HitDistance, filter = self.Owner, mins = Vector( -10, -10, -8 ), maxs = Vector( 10, 10, 8 ), mask = MASK_SHOT_HULL } ) end -- We need the second part for single player because SWEP:Think is ran shared in SP if ( tr.Hit && !( game.SinglePlayer() && CLIENT ) ) then self:EmitSound( HitSound ) end local hit = false if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) then local dmginfo = DamageInfo() local attacker = self.Owner if ( !IsValid( attacker ) ) then attacker = self end dmginfo:SetAttacker( attacker ) dmginfo:SetInflictor( self ) dmginfo:SetDamage( math.random( 2, 4 ) ) if ( anim == "fists_left" ) then dmginfo:SetDamageForce( self.Owner:GetRight() * 4912 + self.Owner:GetForward() * 9998 ) -- Yes we need those specific numbers elseif ( anim == "fists_right" ) then dmginfo:SetDamageForce( self.Owner:GetRight() * -4912 + self.Owner:GetForward() * 9989 ) elseif ( anim == "fists_uppercut" ) then dmginfo:SetDamageForce( self.Owner:GetUp() * 5158 + self.Owner:GetForward() * 10012 ) dmginfo:SetDamage( math.random( 2, 4 ) ) end tr.Entity:TakeDamageInfo( dmginfo ) hit = true end if ( SERVER && IsValid( tr.Entity ) ) then local phys = tr.Entity:GetPhysicsObject() if ( IsValid( phys ) ) then phys:ApplyForceOffset( self.Owner:GetAimVector() * 80 * phys:GetMass(), tr.HitPos ) end end if ( SERVER ) then if ( hit && anim != "fists_uppercut" ) then self:SetCombo( self:GetCombo() + 1 ) else self:SetCombo( 0 ) end end self.Owner:LagCompensation( false )
end
function SWEP:OnDrop() self:Remove() -- You can't drop fists
end
function SWEP:Deploy() local speed = GetConVarNumber( "sv_defaultdeployspeed" ) local vm = self.Owner:GetViewModel() vm:SendViewModelMatchingSequence( vm:LookupSequence( "fists_draw" ) ) vm:SetPlaybackRate( speed ) self:SetNextPrimaryFire( CurTime() + vm:SequenceDuration() / speed ) self:SetNextSecondaryFire( CurTime() + vm:SequenceDuration() / speed ) self:UpdateNextIdle() if ( SERVER ) then self:SetCombo( 0 ) end return true
end
function SWEP:Think() local vm = self.Owner:GetViewModel() local curtime = CurTime() local idletime = self:GetNextIdle() if ( idletime > 0 && CurTime() > idletime ) then vm:SendViewModelMatchingSequence( vm:LookupSequence( "fists_idle_0" .. math.random( 1, 2 ) ) ) self:UpdateNextIdle() end local meleetime = self:GetNextMeleeAttack() if ( meleetime > 0 && CurTime() > meleetime ) then self:DealDamage() self:SetNextMeleeAttack( 0 ) end if ( SERVER && CurTime() > self:GetNextPrimaryFire() + 0.1 ) then self:SetCombo( 0 ) end
end
Ha ok lourd merci beaucoup tu gere
 
  • J'aime
Réactions: Yoh Sambre ♪
MineProdZ

MineProdZ

Geek suprême
Messages
816
Score réaction
120
Points
160
  • Initiateur de la discussion
  • Banni
lampoule

lampoule

Psychopathe
Messages
1 016
Score réaction
332
Points
300
  • J'aime
Réactions: MineProdZ
Discord d'entraide
Rejoignz-nous sur Discord