I have A GUI that is used to remove another GUI off the screen (because from time to time the other GUI gets locked up and is unresponsive).
This "GUI remover" works but if it could be re-scripted to just reset the unresponsive GUI, similarly to when a player rests, that would be a better solution.
Here is a copy of the script.
local Gui = game.Players.LocalPlayer.PlayerGui:FindFirstChild("NewGame")
script.Parent.MouseButton1Click:connect(function(mouse)
Gui:Destroy()
end)
OK thanks to some help this is what I have so far.
I put the GUI "NewGame" in lighting and the "destroy/clone" GUI is in the StarterGui.
This is how it's scripted.
local Gui = game.Players.LocalPlayer.PlayerGui:FindFirstChild("NewGame")
script.Parent.MouseButton1Click:connect(function()
Gui:Destroy()
wait(1)
Game.Lighting.NewGame:Clone().Parent = game.Players.LocalPlayer.PlayerGui
end)
So close but not quite there! Now when I click the GUI remover/reseter, it clears the "NewGame" GUI and waits 1 sec and the cloned GUI returns. However, clicking it a second time I found the "NewGame" was not destroyed just cloned. This can be spam clicked cloning endless "NewGame" GUIs...
Why does it not destroy the “NewGame” GUI after the first click?

1 comment
I don't know if you got the new message or not, but i updated the code, does it work now?