Im trying to make a RNG game, i have certain auras play certain animations. But when using some auras its hard for the player to climb ladders, So basically i want a way to make a animation play all the time, except for when the player is climbing. Is there a way to do that without running loops that stop the animation when climbing?
You could use the event “Humanoid.StateChanged” to detect when the player is climbing a ladder. When the event runs, check to see if the humanoid’s state changed to “Climbing”. The humanoid’s state can be checked using the HumanoidStateType Enum. Make sure to place all of this inside of a PlayerAdded Event as well.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.StateChanged:Connect(function(oldState, newState)
if newState == Enum.HumanoidStateType.Climbing then
-- stop animation here
end
if oldState == Enum.HumanoidStateType.Climbing and newState ~= Enum.HumanoidStateType.Climbing then
-- restart animation here
end
end)
end)
end)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.