As you know there is no Enum.HumanoidStateType.Idle
so how can i check if the player is in idle state ?
This might work:
local player = game.Players.LocalPlayer local humanoid = player.Character:WaitForChild("Humanoid") humanoid.StateChanged:connect(function() if humanoid.MoveDirection == Vector3.new(0, 0, 0) and humanoid:GetState() ~= Enum.HumanoidStateType.Running and humanoid:GetState() ~= Enum.HumanoidStateType.Jumping and humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then print("idle") end end)
btw, make sure the first 2nd line to the 4th line are one line, Since there is no HumanoidStateType.Idle, we can only listen for the Vector3 of the humanoid's RootPart as stated in the wiki
Or rather you can use 'if not' (Don't actually use this script, it is just an example)
if not Enum.HumanoidStateType.Running then if not Enum.HumanoidStateType.Jumping then if not Enum.HumanoidStateType.Freefall then if not Enum.HumanoidStateType.Climbing then etc... print("Humanoid is idling")
-- These states that if the humanoid is 'not' doing these certain StateType then it should print "Humanoid is idling"
Hopefully it helps...