This is a click button one. What is wrong with it it won't close the scripts!
local pg = game.Players.LocalPlayer.PlayerGui if script.Parent.MouseButton1Click:connect(onSelect) then function onSelect() pg.Gui:Remove() wait() end end script.Parent.MouseButton1Click:connect(onSelect) loop(math.huge)
Hmm, try this;
wait(0) --Waits 0 seconds before loading script script.Parent.MouseButton1Click:connect(function() --Player Clicked Gui (Has to be a TextButton) --Rest of coding 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)