Instead of using a loop just set the "loop" property in the ROBLOX animation editor to be true.
anyhow:
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character --Or you can use the characteradded event.
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local anim = humanoid:LoadAnimation(script:WaitForChild("Anim")) --Idle Animation
if anim then
anim:Stop()
end
if anim then
anim:Play()
end
end)
|