PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

StateChanged

This event fires when the state of the Humanoid is changed.

The humanoid state describes the activity the Humanoid is currently doing. It takes the form of a Enum/HumanoidStateType value.

See also:

  • To get and set the state use Humanoid/GetState and Humanoid/ChangeState
  • Individual states can be disabled using Humanoid/SetStateEnabled
  • As there is no idle humanoid state, you should instead use the Humanoid/Running event or listen to the Humanoid/RootPart|RootPart's BasePart/Velocity to work out when the Humanoid is standing still

Parameters

Name Type Default Description

old

The Humanoid|Humanoid's previous state type

new

The Humanoid|Humanoid's current state type


Code Samples


Jumping Particles

Emits particles from the Player|Player's Player/Character when they jump.

To try this code sample, place it inside a LocalScript parented to StarterCharacterScripts|StarterPlayer.StarterCharacterScripts.


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.