Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont the animation stop? the code looks perfectly fine but it doesn't work.

Asked by 5 years ago

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)
0
"orange justice" nope not today fortnite Mr_Unlucky 1085 — 5y
0
XD MrGaming4me 28 — 5y

Answer this question