Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Open a GUI // Frame to a certain player when they join?

Hello, recently I've been trying to look for a code that can show a GUI to a certain player when they join. Only this player can see the GUI and there is a close button for when they have read the text I have gave them. But, I've tried everything I know and google to try and find a script to do this, yet, I cant find or do anything for this to work.

Can anyone help?

1 answer

✓ Accepted answer

Heres a simple way to do it. Basically you want to store the GUI into the ServerStorage, and then check the player's name that has just joined. If its the name of the player you want, you can clone the ScreenGui into their PlayerGui.

--//Services

local serverStorage = game:GetService("ServerStorage")
local players = game:GetService("Players")

--//Functions

local function onPlayerAdded(player) --the player who joined
	if player.Name == "Psudar" then
		local welcomeGui = serverStorage:WaitForChild("WelcomeGui"):Clone()
		welcomeGui.Parent = player.PlayerGui
	end
end

--//Connections

players.PlayerAdded:Connect(onPlayerAdded)

2 comments

0

If you wanted to do this for multiple players, you'd need to use a table and check through that. This is just a simple example, use it as you wish.

0

Thanks! It worked :D

This discussion is preserved as it was. New answers, comments, and votes are closed.