Scripted so any textbutton pressed the player would do an animation, not working, help?
I have a ScreenGui under StarterGui. In the ScreenGui I have a scrolling frame and a text button. The text button is a button that makes the scrolling frame visible if clicked and closes if pressed again.
1 | local sf = script.Parent.Parent.ScrollingFrame |
3 | script.Parent.MouseButton 1 Click:Connect( function () |
4 | sf.Visible = not sf.Visible |
The scrolling frame contains a UIListLayout and a bunch of text buttons named 'Emote'. In each of the emote, there is a local script and a Animation.
The animation for each button is different, I took a long time to put alot of rbxassetid://----- things in each of them. They are all avatar animations. My goal is to when the user clicks, they will start doing the animation. Everything worked perfectly but when I click it doesn't start doing the animation. Here is the local script:
01 | local player = game.Players.LocalPlayer |
02 | local character = player.Character |
04 | character = player.Character |
06 | local hum = character:WaitForChild( "Humanoid" ) |
07 | local emote = hum:LoadAnimation(script.Parent.Animation) |
10 | script.Parent.MouseButton 1 Click:connect( function () |
11 | if playing = = false then |
14 | elseif playing = = true then |
I was wondering if anyone can help me debug or help me.