I want this animation to run onenter and stay running... but when i try it fails to work. Yes i have made my own animation so this works..
Here is my lame attempt
onEnter FindfirstChild:StarterPack.LocalScript local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=222080965" animtrack:play
I'm guessing onEnter means when the player enters. So we use PlayerAdded.
game.Players.PlayerAdded:connect(function(player) print(player.Name) --Prints the player's name. end)
FindFirstChild is a function,
game.StarterPack:FindFirstChild()
You cannot say StarterPack by itself as if it's script or game.
game.StarterPack game:GetService("StarterPack")
You need to load the animation first.
workspace.Player1.Humanoid:LoadAnimation(animation)
Functions like "play" need "()"s at the end.
animation:play()
Now we add this all together
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local script = game.StarterPack.LocalScript if character:FindFirstChild("Humanoid") then local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=222080965" local animtrack = character.Humanoid:LoadAnimation(animation) animtrack:play() end end) end)
Hope this helps!