Quoteory

Untitled

Aug 5th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage") -- could also use serverstorage if you want it to be safer
  3. local Gui = ReplicatedStorage:WaitForChild("ScreenGui") -- the Gui you want the player to have
  4.  
  5. local WhiteList = {[573175315] = true, [28952309] = true} -- table of players that will get the Gui (using UserIDs)
  6.  
  7. Players.PlayerAdded:Connect(function(Player) -- event when player is added
  8.    
  9.     if WhiteList[Player.UserId] then -- checks if they are in the WhiteList table
  10.         Gui:Clone().Parent = Player.PlayerGui -- clones Gui into their PlayerGui
  11.     end
  12.    
  13. end)
Add Comment
Please, Sign In to add comment