Jump to content

Make player walk crouched


BriGhtx3

Recommended Posts

Posted

Hey,

always when I set the control state to crouched then the player crouches for a second and immediately stands up again.

I want the player to always walk crouched and disable sprinting and walking when he is standing:

toggleControl("jump",false) 
    toggleControl("sprint",false) 
toggleControl("walk",false) 
    setControlState("crouch",true) 

Why doesn't this work? It is in a function and clientside

Posted

I already posted my code.

And Im not that dump to make mistakes in the meta.

As you see the player already gets crouched but he stands up immediately.

Posted

You need to set crouching control state to false after a short delay, so that it would be like pressing crouching button instead of holding it down.

Posted (edited)

try this:

toggleControl("walk",false) 
toggleControl("sprint",false) 
toggleControl("jump",false) 
setControlState("crouch",true) 
setTimer(setControlState,1000,1,"crouch",false) 

Edited by Guest
Posted
try this:
toggleControl("walk",false) 
toggleControl("sprint",false) 
toggleControl("jump",false) 
setControlState("crouch",true) 
setTimer(setControlState,1000,1,"crouch",true) 

That'll do the same. As CrystalMV said, it should be set as false after a short time..

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...