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

why wont this animation play when gui is clicked? (unsolved)

Asked by 9 years ago

so i want it to play an animation when i click a gui. im getting no errors but its not playing.

player= game.Players.LocalPlayer 

animation = script:WaitForChild("Animation")

enabled = true 

game.StarterGui.BodyRoll.BodyRollText.MouseButton1Click:connect(function()

    if enabled then 
        enabled = false

animationtrack = player.Character.Humanoid:LoadAnimation(animation)
animationtrack:Play() 

wait(1)     
    end
    end)



0
so wait do TextButtons not have any click function? bubbaman73 143 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

I think you made a typo.

player = game.Players.LocalPlayer 

animation = script:WaitForChild("Animation")

enabled = true 

game.StarterGui.BodyRoll.BodyRollText.MouseButton1Click:connect(function()

    if enabled then 
        enabled = false

animationtrack = player.Character.Humanoid:LoadAnimation(animation)
animationtrack:Play() 

wait(1)     
    end
    end)


0
this does not fix the problem :s bubbaman73 143 — 9y
0
Oops, I MADE A TYPO! Let me try and fix that, then try it. Loleydude 29 — 9y
Ad

Answer this question