Turning off Gravity Kills in Prop Hunt? (code worked then stopped working :/)
4 replies, posted
So I had turned off gravity kills on my prop hunt server but randomly, it turned back on. This is the code I used:
garrysmod/gamemodes/base/gamemode/player.lua
function GM:GetFallDamage( ply, flFallSpeed )
if( GetConVarNumber( "mp_falldamage" ) > 0 ) then -- realistic fall damage is on
return ( flFallSpeed - 0 ) * ( 0 ) -- the Source SDK value
end
return 10
end
I'm new to Lua so any help would be appreciated
If you want to prevent falldamage just do return 0.
Woops, that was meant to be 0 not 10. Let me edit that
Yeah I have return 0 but it still doesnt work
You should be doing this instead of overwriting GM functions
```lua
function GM:GetFallDamage( ply, flFallSpeed )
if( GetConVarNumber( "mp_falldamage" ) > 0 ) then -- realistic fall damage is on
return ( flFallSpeed - 0 ) * ( 0 ) -- the Source SDK value
end
return 0
end
```
Thanks a lot man This worked
Sorry, you need to Log In to post a reply to this thread.