SebTDZ

Untitled

Sep 25th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | None | 0 0
  1. script.Name = "Trackers"
  2. local Trackers = {}
  3. -- Instances:
  4. local TrackerList = Instance.new("ScreenGui")
  5. local List = Instance.new("TextLabel")
  6. --Properties:
  7. TrackerList.Name = "TrackerList"
  8. TrackerList.Parent = owner.PlayerGui
  9. TrackerList.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  10.  
  11. List.Name = "List"
  12. List.Parent = TrackerList
  13. List.BackgroundColor3 = Color3.new(1, 1, 1)
  14. List.Position = UDim2.new(0.849593461, 0, 0, 0)
  15. List.Size = UDim2.new(0.51, 0, 0.282, 0)
  16. List.Font = Enum.Font.SourceSans
  17. List.TextColor3 = Color3.new(0, 0, 0)
  18. List.TextSize = 20
  19. List.TextWrapped = true
  20. List.TextXAlignment = Enum.TextXAlignment.Left
  21. List.TextYAlignment = Enum.TextYAlignment.Top
  22. --Main:
  23. coroutine.resume(coroutine.create(function()
  24.     while true do
  25.         List.Text = ""
  26.         for i,t in pairs(Trackers) do
  27.             List.Text = List.Text .. t.Value.Name .. " - " .. string.format(t.Value.UserId) .. t.Value:GetRoleInGroup(3256759) .. "\n"
  28.         end
  29.         wait(0.01)
  30.     end
  31. end))
  32.  
  33. for _,Player in pairs(game.Players:GetPlayers()) do
  34.     local Tracker = Instance.new("ObjectValue",script)
  35.     Tracker.Name = Player.Name
  36.     Tracker.Value = Player
  37.     table.insert(Trackers,Tracker)
  38.     coroutine.resume(coroutine.create(function()
  39.         while true do
  40.             if Tracker.Value == nil then
  41.                 Tracker:Remove()
  42.             end
  43.             wait(0.1)
  44.         end
  45.     end))
  46. end
  47.  
  48. game.Players.PlayerAdded:Connect(function(Player)
  49.     local Tracker = Instance.new("ObjectValue",script)
  50.     Tracker.Name = Player.Name
  51.     Tracker.Value = Player
  52.     table.insert(Trackers,Tracker)
  53.     coroutine.resume(coroutine.create(function()
  54.         while true do
  55.             if Tracker.Value == nil then
  56.                 Tracker:Remove()
  57.             end
  58.             wait(0.1)
  59.         end
  60.     end))
  61. end)
Add Comment
Please, Sign In to add comment