The StateEnableChanged event fires when
Humanoid/SetStateEnabled is called on the
Parameters include the
Enum/HumanoidStateType in question along with a bool indicating if this state is now enabled.
- To find if a state is currently enabled, use
- To listen to
Humanoidstate changes use
True if the state is now enabled
Humanoid State Change Detector
When a humanoid state changes for the
Players/LocalPlayer, the code below prints whether the state has been enabled or disabled.
This code should work as expected when placed in a
local player = game.Players.LocalPlayer local character = player.CharacterAdded:wait() local humanoid = character.Humanoid humanoid.StateEnabledChanged:Connect(function(state, enabled) if enabled then print(state.Name.." has been enabled") else print(state.Name.." has been disabled") end end)