local Player = game.Players.LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local wavebutton = script.Parent.Parent.Play
local stop = script.Parent.Parent.Parent.Parent.Stop
local anim = game.ReplicatedStorage.Animations.Celebrations.Animation
wavebutton.MouseButton1Click:Connect(function()
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
local track = animator:LoadAnimation(anim)
track.Looped = false
track:Play()
stop.MouseButton1Click:Connect(function()
track.Looped = false
track:Stop()
end)
end)
Starts on line ten when you load the animation.
It plays the animation but if you reset it gives the error
local Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local char = Player.Character or Player.CharacterAdded:Wait()
local wavebutton = script.Parent.Parent.Play
local stop = script.Parent.Parent.Parent.Parent.Stop
local anim = game.ReplicatedStorage.Animations.Celebrations.Animation
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
local track = animator:LoadAnimation(anim)
wavebutton.MouseButton1Click:Connect(function()
track.Looped = false
track:Play()
stop.MouseButton1Click:Connect(function()
track.Looped = false
track:Stop()
end)
end)