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!

1 comment
Because you have player added in your script, the method I showed you won't work, as scripts override what you set the properties to in the Studio if you have the script change the properties.