Does the following script require something extra for it to work?
I'm trying to make a GUI that includes multiple small functions(such as a button that lets you open/close another frame and a reset button). I'm using one single LocalScript, whos parent is just ScreenGui, and I have this:
2 | plr = game.Players.LocalPlayer |
4 | sp.ResetButton.MouseButton 1 Click:connect( function () |
5 | hum = char:findFirstChild( "Humanoid" ) |
For some reason, this works perfectly fine when the localscript is in the button itself, but it doesn't work when it's outside of the button. For convenience sake, I'd rather be able to manage all the buttons in one script. I remember I did something like this last year and it would work, but of course, so much has changed since then, however I don't know if it's something I'm doing wrong or does the code require something extra for it to function again?