Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local YTList = require(script:WaitForChild("YTList"))
- local LocalPlayer = game:GetService("Players").LocalPlayer
- local MarketplaceService = game:GetService("MarketplaceService")
- function IsEven(num)
- return num % 2 == 0
- end
- function CheckBadge(Player)
- local Youtuber = false
- for i, v in pairs(YTList.YouTuberList) do
- if v == Player.Name or v == Player.UserId then
- Youtuber = true
- end
- end
- if Player:GetRankInGroup(5846028) == 255 then
- return "rbxassetid://4866755455"
- elseif Player:GetRankInGroup(5846028) == 250 or Player:GetRankInGroup(5846028) == 244 then
- return "rbxassetid://4866723775"
- elseif Player:GetRankInGroup(5846028) == 230 then
- return "http://www.roblox.com/asset/?id=4867706013"
- elseif Player:GetRankInGroup(5846028) == 100 then
- return "http://www.roblox.com/asset/?id=4867705131"
- elseif Player:IsInGroup(4199740) or YTList.YouTuberList[Player.Name] ~= nil or Youtuber == true or YTList.YouTuberList[Player.UserId] ~= nil then
- return "http://www.roblox.com/asset/?id=4867704715"
- -- elseif MarketplaceService.UserOwnsGamePassAsync(Player.UserId, GamePassiD) then
- -- return "http://www.roblox.com/asset/?id=4867708480"
- else
- return nil
- end
- end
- function CheckTransparency(num)
- if IsEven(num) then
- return 0.5
- else
- return 0.3
- end
- end
- function CheckFriend(Player)
- if Player:IsFriendsWith(LocalPlayer.UserId) then
- return true
- else
- return false
- end
- end
- function PickSlotType(Badge, Friend)
- if Badge == nil then
- if Friend == false then
- return "Player"
- elseif Friend == true then
- return "PlayerF"
- end
- elseif Badge ~= nil then
- if Friend == false then
- return "PlayerB"
- elseif Friend == true then
- return "PlayerBF"
- end
- end
- end
- function AddPlayer(Player)
- local Friend = CheckFriend(Player)
- local Badge = CheckBadge(Player)
- local Slot = PickSlotType(Badge, Friend)
- local PlrSlot = script.Parent:WaitForChild("Defaults"):WaitForChild(Slot):Clone()
- PlrSlot.Name = Player.Name
- PlrSlot:WaitForChild("PlrName").Text = Player.Name
- PlrSlot:WaitForChild("Job").Text = "Civilian"
- PlrSlot:WaitForChild("Level").Text = "0"
- PlrSlot.Visible = true
- if Badge ~= nil then
- PlrSlot:WaitForChild("Badge").Image = Badge
- end
- PlrSlot.Parent = script.Parent:WaitForChild("Players")
- local it = 0
- local tabloplrs = {}
- for i, v in ipairs(script.Parent:WaitForChild("Players"):GetChildren()) do
- if v.ClassName == "Frame" then
- table.insert(tabloplrs, #tabloplrs+1, v.Name)
- end
- end
- table.sort(tabloplrs, function(a, b) return a:lower() < b:lower() end)
- for i, v in ipairs(tabloplrs) do
- it = it +1
- local ColorType = CheckTransparency(it)
- script.Parent:WaitForChild("Players"):WaitForChild(tabloplrs[it]).BackgroundTransparency = ColorType
- end
- end
- function RemovePlayer(Player)
- script.Parent:WaitForChild("Players"):WaitForChild(Player.Name):Destroy()
- local it = 0
- local tabloplrs = {}
- for i, v in ipairs(script.Parent:WaitForChild("Players"):GetChildren()) do
- if v.ClassName == "Frame" then
- table.insert(tabloplrs, #tabloplrs+1, v.Name)
- end
- end
- table.sort(tabloplrs, function(a, b) return a:lower() < b:lower() end)
- for i, v in ipairs(tabloplrs) do
- it = it +1
- local ColorType = CheckTransparency(it)
- script.Parent:WaitForChild("Players"):WaitForChild(tabloplrs[it]).BackgroundTransparency = ColorType
- end
- end
- wait()
- for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
- AddPlayer(player)
- wait()
- end
- game:GetService("Players").PlayerAdded:Connect(function(Player)
- AddPlayer(Player)
- end)
- game:GetService("Players").PlayerRemoving:Connect(function(Player)
- RemovePlayer(Player)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement