SetStateEnabled
For thread safety, this property is not safe to read in an unsynchronized thread.
This function sets whether a given Enum/HumanoidStateType is enabled for the Humanoid.
The humanoid state describes the activity the Humanoid is currently doing.
When a particular Enum/HumanoidStateType is disabled, the Humanoid can never enter that state. This is true regardless if the attempt to change state is made using Humanoid/ChangeState or Roblox internal Humanoid code.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
The |
||
|
|
True if this state is to be enabled, false if it is to be disabled |
Returns
| Return Type | Summary |
|---|---|
|
No return |
Code Samples
Jump Cooldown
The following sample will require a one second cooldown after a Humanoid has landed before it is able to jump again.
To try this sample, place it inside a LocalScript in StarterCharacterScripts|StarterPlayer.StarterCharacterScripts.