I made a gui for dances but the animation wont stop when i press the button the second time the code looks like its supposed to work but it doesnt
function onClicked()
local player = game.Players.LocalPlayer
local Humanoid = player.Character:FindFirstChild("Humanoid")
local dance = script.Parent.Parent.Parent.Dance
local dances = script.Parent.Parent.Parent.Dances
local dancer = nil
local orange_justice = nil
dancer = Humanoid:LoadAnimation(dances.Hype)
orange_justice = Humanoid:LoadAnimation(dances.Orange_Justice)
if dance.Hype.Value == true then
dance.Hype.Value = false
dancer:stop()
else
dance.Hype.Value = true
dance.Orange_Justice.Value = false
orange_justice:stop()
while dance.Hype.Value == true do
wait(4.5)
dancer:play()
end
end
end
script.Parent.MouseButton1Down:connect(onClicked)

2 comments
"orange justice" nope not today fortnite
XD