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
You're over thinking it
local plr = game.Players.LocalPlayer local char = plr.Character or plr.CharacterAdded local hum = char:WaitForChild("Humanoid") script.Parent.MouseButton1Click:connect(function() local anim = hum:LoadAnimation(script.Parent.Animation) anim:Play() end)
and make sure that your animation priority is set as action if its an animation that is quick and isn't looped
Buttons use the activated event, not the mousebutton1down event
try this:
local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation) script.Parent.ScreenGui.TextButton.Activated:Connect(function() animation:Play() wait(1) end)