function playAnimation(humanoid, animationId) local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://"..tostring(animationId) humanoid.Animator:LoadAnimation(animation):Play() end playAnimation(someHumanoid, someAnimationId) Please do not ask people to write entire scripts...
As there is no "idle" humanoid state, you should instead use the Humanoid.Running event or listen to the RootPart part's Velocity to work out when the Humanoid is standing still. See Also Humanoid:GetState() and Humanoid:ChangeState() to get and set the state. Humanoid:SetStateEnabled(...
This event fires approximately two minutes after the game engine classifies the player as idle. Time is the number of seconds that have elapsed since that point. OnTeleport(teleportState : Enum.TeleportState,placeId : number,spawnName : string):RBXScriptSignal Fired when the TeleportState of a...