I have made a Text Button that should make an animation play in the person who clicks it, but it doesn't work. Where did I go wrong? It doesn't work in ROBLOX studio or the game. I was wondering how to fix the script. It is a Local Script inside the Text Button.
local animation = Instance.new("Animation")
animation.animationId ="rbxassetid://2778577214"
local trackanimation = nil
local playability = true
function playanimation(AnimationSource)
if playability == true then
local plr = game.players.localplayer
trackanimation = plr.character.humanoid:loadanimation(animation)
trackanimation.keyframereached:connect(function()
print("ChasingNachos")
end)
trackanimation:play()
end
end
script.Parent.MouseButton1Click:connect(playanimation)?

4 comments
Don't forget to accept my answer if it solves your problem.
please forget
shup gisoni01
You use AnimationId. Not animationId