I have a Hide Gui button and don’t know how to reverse the effects by clicking the button again. Is there a simple line of code I can add to achieve this? Here is the script I currently have:
All of the children of StarterGui are cloned into a player’s PlayerGui, so changing something in StarterGui will not change it for any players. script.Parent.Parent, on the other hand, references the PlayerGui, so values can be changed while the game is running.
Regarding this, script.Parent.Parent means navigation to instance starting from the location of script. And game.StarterGui.ScreenGui is wrong since each time player respawn(unless gui reset on respawn is set to off) and joins the game for the first time(Unless auto loading of a character is set off too) it will clone every instance of StarterGui service to PlayerGui. I think you meant to type game.Players.LocalPlayer.PlayerGui[Further location to your GUI starting from StarterGui]. They are basically the same. Only change would be if you move script to another instance, so it will take effect and won’t point at the same instance you originally intended it to point at. Keep this in mind so you won’t be confused later!