#How do I disable jumping and ducking?

1 messages · Page 1 of 1 (latest)

cyan valve
#

Pretty sure you'd use CUserCmd:RemoveKey( IN_DUCK ) inside a SetupMove hook
https://wiki.facepunch.com/gmod/GM:SetupMove
https://wiki.facepunch.com/gmod/CUserCmd:RemoveKey

cyan valve
#

huh, that looks fine to me

#

not sure what could be wrong

cyan valve
#

So the weird thing is, this works if I change it to IN_JUMP

#

just not for IN_DUCK

#

I also tried ```lua
hook.Add( "StartCommand", "DisableDuck", function( ply, cmd )
cmd:SetButtons( bit.band( cmd:GetButtons( ), bit.bnot( IN_JUMP ) ) )
end )

and it worked perfectly (for jumping)
cyan valve
#

Genuinely, I don't know why this isn't working

knotty steeple
#

Idk if it's the reason why it's not working for IN_DUCK but SetupMove is predicted and won't be called on client in a single player server

cyan valve
#

I tested this on a dedicated server