get players gesture

Hey so what I’m trying to do is get whether the players animation is currently ACT_GMOD_NOCLIP_LAYER or not, and if it is to return on a function i have. The problem is when i use:

if(ply:IsPlayingGesture( ACT_GMOD_NOCLIP_LAYER )) then return end

then it throws this error:

attempt to call method ‘IsPlayingGesture’ (a nil value)

I really don’t know why this is happening and there is no other way to find out what gesture is currently playing on a player, please help! Thanks in advance!

IsPlayingGesture only works serverside.

oh crap I didn’t notice, alright so what I need to do is this:

When someone is noclipping then naturally the noclip animation is played, however when you noclip outside the map and back in and look at the person noclipping, it simply plays the falling animation, and for the playermodel I’m working with I need to fix this. What i was doing was a PostPlayerDraw hook for clients, and if their noclipping then it runs:

ply:AnimRestartGesture( GESTURE_SLOT_CUSTOM, ACT_GMOD_NOCLIP_LAYER, false )

However this constantly restarts it to the beginning of the animation, i somehow need to find out if that animation is already playing and if it is then don’t run the code. Could you please give me a hand solving this?

Can’t you just use


ply:GetMoveType() == MOVETYPE_NOCLIP

Since your second post seems to indicate that you want to check if a player is noclipping or not.
Check if the player is noclipping, if he is and the gesture is not being played, restart it. That should make sure the restart only triggers once the gesture stops.