I've received complaints from my players about the welcome GUI being annoying as it pops up when you respawn, not just when you join the game or click the open introduction button. I have tried my best but not succeeded in getting my script to make the GUI open at these times.
Here is the code I started off with:
local frame = script.Parent.Parent.IntroGUI local open = false script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true end end)
This is the script I have now, and this does the same as the one before, only more lengthy. This was an attempt to make is so that the problem is fixed, however it has not worked.
local frame = script.Parent.Parent.IntroGUI local open = false if game.Players.PlayerAdded == true then frame.Visible = true elseif script.Parent.MouseButton1Click then script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true end end) else frame.Visible = false end
This is my GUI tree:
file:///Users/adam/Desktop/Screenshot%202020-05-01%20at%2011.24.59.png
And this is my GUI:
file:///Users/adam/Desktop/Screenshot%202020-05-01%20at%2011.25.40.png
This is the script for my GUI close button:
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false end)
Hope someone can help!
It's actually easier than you think. There is a property for every GUI called "ResetOnSpawn". Just go to it in Properties for your GUI and set it to false. Then it will not show up when a player respawns.