Essentially, I want a player to have this dance when he or she enters the game. I'm pretty sure I did everything right, but the animation still doesn't fire:
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local animation=Instance.new("Animation") animation.AnimationId="http://www.roblox.com/Asset?ID=160934457" local animTrack=character.Humanoid:LoadAnimation(animation) wait(3) animTrack:Play() print("test") end) end)
There aren't any errors in the output, and it prints "test".
Your help would be great!
Everything seems fine except the Asset ID (like Discern pointed out), if there is anything in the output please post it.
EDIT: When using an animation you must play it from a local script! So in this case just put a local script in StarterPack or StarterGui and it should work when the player spawns.
Use the code below in a LocalScript
repeat wait() player = game.Players.LocalPlayer character = player.Character until (player) and (character) local animation = Instance.new("Animation", character) animation.AnimationId = "http://www.roblox.com/Asset?ID=160934458" local animTrack = character.Humanoid:LoadAnimation(animation) wait(3) animTrack:Play() print("test")
If you are still having trouble, then just read through the wiki article below carefully.
http://wiki.roblox.com/index.php?title=Animations
If this works, then don't forget to mark this as the answer!