Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage") -- could also use serverstorage if you want it to be safer
- local Gui = ReplicatedStorage:WaitForChild("ScreenGui") -- the Gui you want the player to have
- local Gui2 = ReplicatedStorage:WaitForChild("ScreenGui2") -- the Gui you want the player to have
- local Guis = {Gui, Gui2} -- table of all of the Guis we want the player to get
- local WhiteList = {[573175315] = true, [28952309] = true} -- table of players that will get the Gui (using UserIDs)
- Players.PlayerAdded:Connect(function(Player) -- event when player is added
- if WhiteList[Player.UserId] then -- checks if they are on the list
- Player.CharacterAdded:Connect(function() -- adds the guis whenever they spawn
- wait()
- for i = 1, #Guis do -- loops through Guis table and clones it into their PlayerGui
- Guis[i]:Clone().Parent = Player.PlayerGui
- end
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement