• Fall Damage
    3 replies, posted
Can someone just post a hook or function or anything that will increase falldamage. I need the damage to kill someone if they hit something at terminal velocity. Thanks in advance
[code]function FallDamage( ent, inflictor, attacker, amount, dmginfo ) if ( ent:IsPlayer() ) then --Is player? if (ent:GetVelocity():Length() > 50 and dmginfo:IsFallDamage()) then --How fast and was it fall damage? dmginfo:SetDamage (1000) --How much damage to do. end end end hook.Add("EntityTakeDamage", "FallDamage", FallDamage) [/code] Not tested but all you should have to do is change the "50" to whatever works.
[QUOTE=Kidd;30024538][code]function FallDamage( ent, inflictor, attacker, amount, dmginfo ) if ( ent:IsPlayer() ) then --Is player? if (ent:GetVelocity():Length() > 50 and dmginfo:IsFallDamage()) then --How fast and was it fall damage? dmginfo:SetDamage (1000) --How much damage to do. end end end hook.Add("EntityTakeDamage", "FallDamage", FallDamage) [/code] Not tested but all you should have to do is change the "50" to whatever works.[/QUOTE] And where should i put this?
lua/autorun/server
Sorry, you need to Log In to post a reply to this thread.