Advertisement
Quoteory

Untitled

Aug 5th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage") -- could also use serverstorage if you want it to be safer
  4. local Gui = ReplicatedStorage:WaitForChild("ScreenGui") -- the Gui you want the player to have
  5. local Gui2 = ReplicatedStorage:WaitForChild("ScreenGui2") -- the Gui you want the player to have
  6.  
  7. local Guis = {Gui, Gui2} -- table of all of the Guis we want the player to get
  8.  
  9. local WhiteList = {[573175315] = true, [28952309] = true} -- table of players that will get the Gui (using UserIDs)
  10.  
  11. Players.PlayerAdded:Connect(function(Player) -- event when player is added
  12.     if WhiteList[Player.UserId] then -- checks if they are on the list
  13.        
  14.         Player.CharacterAdded:Connect(function() -- adds the guis whenever they spawn
  15.             wait()
  16.             for i = 1, #Guis do -- loops through Guis table and clones it into their PlayerGui
  17.                 Guis[i]:Clone().Parent = Player.PlayerGui
  18.             end
  19.        
  20.         end)
  21.        
  22.     end
  23.    
  24. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement