Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players") -- States a variable for ease. Use GetService!
- local SecurityCheck = { -- Lists the rank Security for table SecurityCheck.
- [6 | Security] = true;
- }
- local HRCheck = { -- Lists all high ranks that will get you banned for table HRCheck.
- [8 | Head of Security] = true;
- [9 | Head of Services] = true;
- [10 | Head Receptionist] = true;
- [11 | Management] = true;
- [12 | Senior Management] = true;
- [14 | Shift Manager] = true;
- [15 | General Manager] = true;
- [16 | Board of Directors] = true;
- [17 | Vice Chairman] = true;
- [18 | Chairman] = true;
- }
- function CreateNotification(Title)
- local Notification = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- Notification.Name = "Notification"
- Notification.Parent = game.CoreGui
- Frame.Parent = Notification
- Frame.BackgroundColor3 = Color3.new(42/255 42/255 42/255)
- Frame.BackgroundTransparency = 0.2
- Frame.BorderSizePixel = 0
- Frame.Position = UDim2.new(0 0 -0.1 0)
- Frame.Size = UDim2.new(1 0 0.0183374081 30)
- TextLabel.Parent = Frame
- TextLabel.BackgroundColor3 = Color3.new(1 1 1)
- TextLabel.BackgroundTransparency = 1
- TextLabel.Position = UDim2.new(0.31437701 0 0 0)
- TextLabel.Size = UDim2.new(0.370607018 0 1 0)
- TextLabel.Font = Enum.Font.SourceSansLight
- TextLabel.Text = Title
- TextLabel.TextColor3 = Color3.new(0.905882 0.905882 0.905882)
- TextLabel.TextSize = 30
- Frame:TweenPosition(UDim2.new(0 0 0 0) "In" "Linear" .2)
- wait(2.2)
- Frame:TweenPosition(UDim2.new(0 0 -.1 0) "Out" "Quad" .2)
- wait(.2)
- Notification:Destroy()
- end
- function onPlayerAdded(player) -- OnPlayerAdded is the function name. player is referred to what changes.
- if SecurityCheck[player:WaitForChild("leaderstats" 3).Rank.Value] then -- If the table matches then..
- CreateNotification(tostring(player).. " has joined. Rank: Security")
- wait()
- end
- if HRCheck[player:WaitForChild("leaderstats" 3).Rank.Value] then -- If the table matches then..
- CreateNotification("WARNING!".. tostring(player).. "has joined." "Rank: ".. player:WaitForChild("leaderstats" 3).Rank.Value)
- wait(1)
- end
- end
- --When a player joins call the onPlayerAdded function
- Players.PlayerAdded:connect(onPlayerAdded)
- --Call onPlayerAdded for each player already in the game
- for _player in pairs(Players:GetPlayers()) do
- onPlayerAdded(player)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement