I am making a custom PlayerList, it works great. But there is one thing. I want the player list to look good since I am releasing it to the public. But for some reason the player status feature won’t work, though I am the creator of the game. Ill show you the entire local script:
local pCloner = script.Parent:WaitForChild("pCloner")
local playerScroller = script.Parent:WaitForChild("PlayerScroller")
local localPlayer = game:GetService("Players").LocalPlayer
local function updatePlayerList()
for index, playerFrame in pairs(playerScroller:GetChildren()) do
if playerFrame:IsA("Frame") then
playerFrame:Destroy()
end
end
for index, player in pairs(game:GetService("Players"):GetPlayers()) do
local PlayerClone = pCloner:Clone()
local PlayerStatus = PlayerClone:WaitForChild("PlayerStatus")
local PlayerDisplay = PlayerClone:WaitForChild("PlayerName")
-- the status feature starts here --
if player.MembershipType == Enum.MembershipType.Premium then
PlayerStatus.Image = "rbxasset://textures/ui/PlayerList/PremiumIcon.png"
elseif player.MembershipType == Enum.MembershipType.None then
PlayerStatus.Image = ""
elseif player.UserId == game.CreatorId then
PlayerStatus.Image = "rbxasset://textures/ui/PlayerList/developer.png"
elseif player:GetRankInGroup(1200769) == 150 then
PlayerStatus.Image = "rbxasset://textures/ui/PlayerList/AdminIcon.png"
elseif player:GetRankInGroup(4199740) == 1 then
PlayerStatus.Image = "rbxasset://LuaPackages/Packages/_Index/UIBlox/UIBlox/App/ImageSet/ImageAtlas/img_set_1x_2.png"
PlayerStatus.ImageRectOffset = Vector2.new(490, 346)
PlayerStatus.ImageRectSize = Vector2.new(16, 16)
elseif localPlayer:IsFriendsWith(player.UserId) then
PlayerStatus.Image = "rbxasset://textures/ui/PlayerList/FriendIcon.png"
end
PlayerDisplay.Text = player.DisplayName
PlayerClone.Parent = playerScroller
PlayerClone.Name = player.DisplayName
PlayerClone.Visible = true
playerScroller.CanvasSize = UDim2.new(0,0,0,playerScroller.UIListLayout.AbsoluteContentSize.Y)
end
end
updatePlayerList()
game:GetService("Players").PlayerAdded:Connect(updatePlayerList)
game:GetService("Players").PlayerRemoving:Connect(updatePlayerList)