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 10 years ago

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

01player= game.Players.LocalPlayer
02 
03animation = script:WaitForChild("Animation")
04 
05enabled = true
06 
07game.StarterGui.BodyRoll.BodyRollText.MouseButton1Click:connect(function()
08 
09    if enabled then
10        enabled = false
11 
12animationtrack = player.Character.Humanoid:LoadAnimation(animation)
13animationtrack:Play()
14 
15wait(1)    
16    end
17    end)
0
so wait do TextButtons not have any click function? bubbaman73 143 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

I think you made a typo.

01player = game.Players.LocalPlayer
02 
03animation = script:WaitForChild("Animation")
04 
05enabled = true
06 
07game.StarterGui.BodyRoll.BodyRollText.MouseButton1Click:connect(function()
08 
09    if enabled then
10        enabled = false
11 
12animationtrack = player.Character.Humanoid:LoadAnimation(animation)
13animationtrack:Play()
14 
15wait(1)    
16    end
17    end)
0
this does not fix the problem :s bubbaman73 143 — 10y
0
Oops, I MADE A TYPO! Let me try and fix that, then try it. Loleydude 29 — 10y
Ad

Answer this question