so i want it to play an animation when i click a gui. im getting no errors but its not playing.
01 | player = game.Players.LocalPlayer |
02 |
03 | animation = script:WaitForChild( "Animation" ) |
04 |
05 | enabled = true |
06 |
07 | game.StarterGui.BodyRoll.BodyRollText.MouseButton 1 Click:connect( function () |
08 |
09 | if enabled then |
10 | enabled = false |
11 |
12 | animationtrack = player.Character.Humanoid:LoadAnimation(animation) |
13 | animationtrack:Play() |
14 |
15 | wait( 1 ) |
16 | end |
17 | end ) |
I think you made a typo.
01 | player = game.Players.LocalPlayer |
02 |
03 | animation = script:WaitForChild( "Animation" ) |
04 |
05 | enabled = true |
06 |
07 | game.StarterGui.BodyRoll.BodyRollText.MouseButton 1 Click:connect( function () |
08 |
09 | if enabled then |
10 | enabled = false |
11 |
12 | animationtrack = player.Character.Humanoid:LoadAnimation(animation) |
13 | animationtrack:Play() |
14 |
15 | wait( 1 ) |
16 | end |
17 | end ) |