local button = script.Parent local user = game.Players.LocalPlayer local char = user.Character local humanoid = char.Humanoid local anim = humanoid:LoadAnimation(button.Anim) function action() anim:Play() wait(1) anim:Stop() end button.MouseButton1Down:connect(action)
Wait for the Character object, Humanoid, and the animation object!
local button = script.Parent local user = game.Players.LocalPlayer local char = user.Character or user.CharacterAdded:wait() local humanoid = char:WaitForChild("Humanoid") local anim = humanoid:LoadAnimation(button:WaitForChild("Anim")) function action() anim:Play() wait(1) anim:Stop() end button.MouseButton1Down:connect(action)