Hello, I’m making animations UI when player clicks the button it they will start dancing but I can’t find any bug in the script or errors in output, here’s script:
Script
local button = script.Parent
local animation = script.Animation
local player = game.Players.LocalPlayer
local humanoid = player.Character:WaitForChild(“Humanoid”)
playing = false
local function PlayDance()
local playerDance = humanoid:LoadAnimation(animation)
if playing == false then
playerDance:Play()
playing = true
print(“Starting Animation!”)
elseif playing == true then
playerDance:Stop()
playing = false
print(“Stoping animation!”)
end
end
button.MouseButton1Click:Connect(PlayDance)
Also here’s explorer part
What you think where’s my mistake?