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.
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.