BriGhtx3 Posted September 5, 2012 Share Posted September 5, 2012 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 Link to comment
TwiX! Posted September 5, 2012 Share Posted September 5, 2012 show your code and meta Link to comment
BriGhtx3 Posted September 5, 2012 Author Share Posted September 5, 2012 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. Link to comment
DiSaMe Posted September 5, 2012 Share Posted September 5, 2012 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. Link to comment
Jaysds1 Posted September 5, 2012 Share Posted September 5, 2012 (edited) try this: toggleControl("walk",false) toggleControl("sprint",false) toggleControl("jump",false) setControlState("crouch",true) setTimer(setControlState,1000,1,"crouch",false) Edited September 5, 2012 by Guest Link to comment
Anderl Posted September 5, 2012 Share Posted September 5, 2012 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.. Link to comment
BriGhtx3 Posted September 6, 2012 Author Share Posted September 6, 2012 (edited) Works now I set delay to 100. Thank you Edited September 10, 2012 by Guest Link to comment
Jaysds1 Posted September 7, 2012 Share Posted September 7, 2012 nice to see it working, have fun Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now