basc, i made a animation and to start it i press a button and the animation is an loop but when i press the button again it doesn't stop the animation. how do i make it stop?
the code is
local click = script.Parent.MouseButton1Click
local players = game:GetService("Players")
local char = players.LocalPlayer.Character
if not char then
players.LocalPlayer.CharacterAdded:Wait()
end
local hum = char:WaitForChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://" -- your id
local animationtrack = hum:LoadAnimation(animation)
function playAnimation()
animationtrack:Play()
end
click:Connect(playAnimation)
** You are now Level 2! **