Advertisement
4zx16

Private GUI (Whitelist)

Jul 18th, 2021 (edited)
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || PRIVATE GUI (WHITELIST)
  3. ]]
  4. local ServerAction = {
  5.     ["F"] = true -- make sure this is set to true or it will not work!
  6. }
  7. --[[
  8.  || 📜 Whitelisted Usernames (Not Recommended)
  9. ]]
  10. local StoredData = {""} -- any amount of people can be on the list
  11. local StoredGUI = game:GetService("ReplicatedStorage").Name -- the name of ur gui use ["gui name"] if spaced.
  12.  
  13. game.Players.PlayerAdded:Connect(function(JoinAction)
  14.     local function SendData()
  15.         StoredGUI:Clone().Parent = JoinAction:WaitForChild("PlayerGui")
  16.     end
  17.     if ServerAction.F == true then
  18.         -- Was enabled via Studio
  19.         for _, Yes in pairs(StoredData) do
  20.             if JoinAction.Name == Yes then
  21.                 SendData()
  22.                 -- Stops Here
  23.             end
  24.         end
  25.     end
  26. end)
  27. --[[
  28.  || 📜 Whitelisted UserIds (Recommended)
  29. ]]
  30. local StoredData_IDs = {""}  -- any amount of people can be on the list (PLAYER IDs ONLY)
  31.  
  32. game.Players.PlayerAdded:Connect(function(JoinAction)
  33.     local function SendData() -- Sends GUI to the client
  34.         StoredGUI:Clone().Parent = JoinAction:WaitForChild("PlayerGui")
  35.     end
  36.     if ServerAction.F == true then
  37.         -- Was enabled via Studio
  38.         for _, Yes in pairs(StoredData_IDs) do
  39.             if JoinAction.UserId == Yes then
  40.                 SendData() -- Sends GUI to the client
  41.                 -- Stops Here
  42.             end
  43.         end
  44.     end
  45. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement