I need to know how to script something where when a player enters the game they get a certain GUI that appears in front of them and closes after they said okay. It won't show up again if the player dies.
✓ ANSWER ACCEPTED
How to make a gui appear upon player joining the server
2 answers
✓ Accepted answer
Put a script in the button gui that you want to close the gui when clicked and put this code in it:
local gui = script.Parent.Parent --the gui to be removed, screengui
local button = script.Parent --the button (gui.button) textbutton/imagebutton
button.MouseButton1Down:connect(function()
gui:Destroy()
end)
To make the gui visible when the player joins and only when the player joins, put the gui in game.Lighting and put the following code in a script in workspace,
local gui = game.Lighting.MyGui -- the name of your gui
game.Players.PlayerAdded:connect(function(player)
player:WaitForChild("PlayerGui")
gui:Clone().Parent = player.PlayerGui
end)
good luck
Try something with this event
local firstJoin = false --Checks for condition
game.Players.PlayerAdded:connect(function(player)
if firstJoin == false then
firstJoin = true --Sets condition to opposite of what the 'if' statement is looking for.
--GUI code here
end
end)
There! Should probably work. Right off the top of my head though.
2 comments
0
You don't need a bool to check whether the player has joined the game already or not since the PlayerAdded event only fires once (when the player first joins)
0
Oh. Sorry, I was really tired when I posted that.
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
First script works for some reason the 2nd on doesn't
Did you edit this line (1)? local gui = game.Lighting.MyGui
Yes it refused to work. Ill post the output on the next comment.
http://prntscr.com/2ybdqq
Oh, that's because the PlayerGui doesn't load instantly, try it now.
Thank you so much! It works now also if you know any person who can make gun weapons for the group I belong could you let me know?