Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. local Players = game:GetService("Players") -- States a variable for ease. Use GetService!
  2.  
  3. local SecurityCheck = { -- Lists the rank Security for table SecurityCheck.
  4. [6 | Security] = true;
  5. }
  6.  
  7. local HRCheck = { -- Lists all high ranks that will get you banned for table HRCheck.
  8. [8 | Head of Security] = true;
  9. [9 | Head of Services] = true;
  10. [10 | Head Receptionist] = true;
  11. [11 | Management] = true;
  12. [12 | Senior Management] = true;
  13. [14 | Shift Manager] = true;
  14. [15 | General Manager] = true;
  15. [16 | Board of Directors] = true;
  16. [17 | Vice Chairman] = true;
  17. [18 | Chairman] = true;
  18. }
  19.  
  20. function CreateNotification(Title)
  21.  
  22. local Notification = Instance.new("ScreenGui")
  23. local Frame = Instance.new("Frame")
  24. local TextLabel = Instance.new("TextLabel")
  25.  
  26. Notification.Name = "Notification"
  27. Notification.Parent = game.CoreGui
  28.  
  29. Frame.Parent = Notification
  30. Frame.BackgroundColor3 = Color3.new(42/255 42/255 42/255)
  31. Frame.BackgroundTransparency = 0.2
  32. Frame.BorderSizePixel = 0
  33. Frame.Position = UDim2.new(0 0 -0.1 0)
  34. Frame.Size = UDim2.new(1 0 0.0183374081 30)
  35.  
  36. TextLabel.Parent = Frame
  37. TextLabel.BackgroundColor3 = Color3.new(1 1 1)
  38. TextLabel.BackgroundTransparency = 1
  39. TextLabel.Position = UDim2.new(0.31437701 0 0 0)
  40. TextLabel.Size = UDim2.new(0.370607018 0 1 0)
  41. TextLabel.Font = Enum.Font.SourceSansLight
  42. TextLabel.Text = Title
  43. TextLabel.TextColor3 = Color3.new(0.905882 0.905882 0.905882)
  44. TextLabel.TextSize = 30
  45.  
  46. Frame:TweenPosition(UDim2.new(0 0 0 0) "In" "Linear" .2)
  47. wait(2.2)
  48. Frame:TweenPosition(UDim2.new(0 0 -.1 0) "Out" "Quad" .2)
  49. wait(.2)
  50. Notification:Destroy()
  51. end
  52.  
  53. function onPlayerAdded(player) -- OnPlayerAdded is the function name. player is referred to what changes.
  54. if SecurityCheck[player:WaitForChild("leaderstats" 3).Rank.Value] then -- If the table matches then..
  55. CreateNotification(tostring(player).. " has joined. Rank: Security")
  56. wait()
  57. end
  58. if HRCheck[player:WaitForChild("leaderstats" 3).Rank.Value] then -- If the table matches then..
  59. CreateNotification("WARNING!".. tostring(player).. "has joined." "Rank: ".. player:WaitForChild("leaderstats" 3).Rank.Value)
  60. wait(1)
  61. end
  62. end
  63.  
  64. --When a player joins call the onPlayerAdded function
  65. Players.PlayerAdded:connect(onPlayerAdded)
  66.  
  67. --Call onPlayerAdded for each player already in the game
  68. for _player in pairs(Players:GetPlayers()) do
  69. onPlayerAdded(player)
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement