local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
script.Parent.ScreenGui.TextButton.MouseButton1Click:Connect(function()
animation:Play()
wait(1)
end)
LocalScript inside StartGUI
When you press a button the animation will play but it didnt

2 comments
and make sure u put the local script inside the button and make sure the animation is in the button too
works