Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by
Psudar 882 Moderation Voter
4 years ago
Edited 4 years ago

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)
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. Psudar 882 — 4y
0
Thanks! It worked :D DiamondRules01 56 — 4y
Ad

Answer this question