This is a click button one. What is wrong with it it won't close the scripts!
01 | local pg = game.Players.LocalPlayer.PlayerGui |
02 |
03 | if script.Parent.MouseButton 1 Click:connect(onSelect) then |
04 |
05 | function onSelect() |
06 | pg.Gui:Remove() |
07 | wait() |
08 | end |
09 | end |
10 |
11 | script.Parent.MouseButton 1 Click:connect(onSelect) |
12 |
13 | loop( math.huge ) |
Hmm, try this;
1 | wait( 0 ) --Waits 0 seconds before loading script |
2 | script.Parent.MouseButton 1 Click:connect( function () --Player Clicked Gui (Has to be a TextButton) |
3 | --Rest of coding |
4 | end ) --The end for the event/function |
Hope this helped!
I use this evevnt/function most of the times for TextButtons, and it works most of the times try using this: ;) I hope I helped
script.Parent.MouseButton1Down:connect(function() -- What your code here for the TextButton, put it in here end)