Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.64 KB | None | 0 0
  1. local YTList = require(script:WaitForChild("YTList"))
  2. local LocalPlayer = game:GetService("Players").LocalPlayer
  3. local MarketplaceService = game:GetService("MarketplaceService")
  4.  
  5. function IsEven(num)
  6.     return num % 2 == 0
  7. end
  8.  
  9. function CheckBadge(Player)
  10.     local Youtuber = false
  11.     for i, v in pairs(YTList.YouTuberList) do
  12.         if v == Player.Name or v == Player.UserId then
  13.             Youtuber = true
  14.         end
  15.     end
  16.     if Player:GetRankInGroup(5846028) == 255 then
  17.         return "rbxassetid://4866755455"
  18.     elseif Player:GetRankInGroup(5846028) == 250 or Player:GetRankInGroup(5846028) == 244 then
  19.         return "rbxassetid://4866723775"
  20.     elseif Player:GetRankInGroup(5846028) == 230 then
  21.         return "http://www.roblox.com/asset/?id=4867706013"
  22.     elseif Player:GetRankInGroup(5846028) == 100 then
  23.         return "http://www.roblox.com/asset/?id=4867705131"
  24.     elseif Player:IsInGroup(4199740) or YTList.YouTuberList[Player.Name] ~= nil or Youtuber == true or YTList.YouTuberList[Player.UserId] ~= nil then
  25.         return "http://www.roblox.com/asset/?id=4867704715"
  26.     -- elseif MarketplaceService.UserOwnsGamePassAsync(Player.UserId, GamePassiD) then
  27.         -- return "http://www.roblox.com/asset/?id=4867708480"
  28.     else
  29.         return nil
  30.     end
  31. end
  32.  
  33. function CheckTransparency(num)
  34.     if IsEven(num) then
  35.         return 0.5
  36.     else
  37.         return 0.3
  38.     end
  39. end
  40.  
  41. function CheckFriend(Player)
  42.     if Player:IsFriendsWith(LocalPlayer.UserId) then
  43.         return true
  44.     else
  45.         return false
  46.     end
  47. end
  48.  
  49. function PickSlotType(Badge, Friend)
  50.     if Badge == nil then
  51.         if Friend == false then
  52.             return "Player"
  53.         elseif Friend == true then
  54.             return "PlayerF"
  55.         end
  56.     elseif Badge ~= nil then
  57.         if Friend == false then
  58.             return "PlayerB"
  59.         elseif Friend == true then
  60.             return "PlayerBF"
  61.         end
  62.     end
  63. end
  64.  
  65. function AddPlayer(Player)
  66.     local Friend = CheckFriend(Player)
  67.     local Badge = CheckBadge(Player)
  68.     local Slot = PickSlotType(Badge, Friend)
  69.     local PlrSlot = script.Parent:WaitForChild("Defaults"):WaitForChild(Slot):Clone()
  70.    
  71.     PlrSlot.Name = Player.Name
  72.     PlrSlot:WaitForChild("PlrName").Text = Player.Name
  73.     PlrSlot:WaitForChild("Job").Text = "Civilian"
  74.     PlrSlot:WaitForChild("Level").Text = "0"
  75.     PlrSlot.Visible = true
  76.     if Badge ~= nil then
  77.         PlrSlot:WaitForChild("Badge").Image = Badge
  78.     end
  79.     PlrSlot.Parent = script.Parent:WaitForChild("Players")
  80.     local it = 0
  81.     local tabloplrs = {}
  82.     for i, v in ipairs(script.Parent:WaitForChild("Players"):GetChildren()) do
  83.         if v.ClassName == "Frame" then
  84.             table.insert(tabloplrs, #tabloplrs+1, v.Name)
  85.         end
  86.     end
  87.     table.sort(tabloplrs, function(a, b) return a:lower() < b:lower() end)
  88.     for i, v in ipairs(tabloplrs) do
  89.         it = it +1
  90.         local ColorType = CheckTransparency(it)
  91.         script.Parent:WaitForChild("Players"):WaitForChild(tabloplrs[it]).BackgroundTransparency = ColorType
  92.     end
  93. end
  94.  
  95. function RemovePlayer(Player)
  96.     script.Parent:WaitForChild("Players"):WaitForChild(Player.Name):Destroy()
  97.     local it = 0
  98.     local tabloplrs = {}
  99.     for i, v in ipairs(script.Parent:WaitForChild("Players"):GetChildren()) do
  100.         if v.ClassName == "Frame" then
  101.             table.insert(tabloplrs, #tabloplrs+1, v.Name)
  102.         end
  103.     end
  104.     table.sort(tabloplrs, function(a, b) return a:lower() < b:lower() end)
  105.     for i, v in ipairs(tabloplrs) do
  106.         it = it +1
  107.         local ColorType = CheckTransparency(it)
  108.         script.Parent:WaitForChild("Players"):WaitForChild(tabloplrs[it]).BackgroundTransparency = ColorType
  109.     end
  110. end
  111.  
  112. wait()
  113. for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
  114.     AddPlayer(player)
  115.     wait()
  116. end
  117.  
  118. game:GetService("Players").PlayerAdded:Connect(function(Player)
  119.     AddPlayer(Player)
  120. end)
  121.  
  122. game:GetService("Players").PlayerRemoving:Connect(function(Player)
  123.     RemovePlayer(Player)
  124. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement