Fall Damage

Hey there if anyone knows a small line or paragraph of code to give me which will disable fall damage on my sandbox server i will be very great full thanks!

function GM:ScaleNPCDamage(npc,hitgroup,dmginfo) if dmginfo:IsFallDamage() then dmginfo:ScaleDamage(0) end end

Thanks

mp_falldamage 0

Or does that not work in garry’s mod?

I don’t think that’s a gmod cvar.


i hate to be that guy but code tags always help

it’s one line of code, code tags aren’t needed

mp_falldamage turns off/on the damage ramp based on player velocity. When it’s set to 0, all fall damage is limited to -10 hp per fall.

Do NOT override gamemode functions unless it is for a custom gamemode. Use hooks instead.



function ReduceFallDamage(ent, inflictor, attacker, amount, dmginfo)
	if ent:IsPlayer() and dmginfo:IsFallDamage() then
		dmginfo:SetDamage(1)
	end
end
hook.Add("EntityTakeDamage", "RemoveFallDamage", ReduceFallDamage)


Stick it in lua/autorun