Hello, (ik I’m annoying )
I’m trying to FINALLY finish the spectating GUI, I got this script :
-- Disable the player list / leaderboard
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
-- Variables
local playerListButton = script.Parent:WaitForChild("PlayerListButton")
local playerListFrame = script.Parent:WaitForChild("MainFrame")
-- Open/Close Gui
-- Updating the leaderboard
while wait(1) do
-- Deletes everything until we make a frame
for _, plrFrame in pairs(playerListFrame.PlayerHolder:GetChildren()) do
if plrFrame:IsA("Frame") then
plrFrame:Destroy()
end
end
-- Making a frame for the player
for i, plr in pairs(game.Players:GetPlayers()) do
local template = script:WaitForChild("Template"):Clone()
template.Name = plr.Name
template.PlayerPicture.Image = game.Players:GetUserThumbnailAsync(plr.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)
template.PlayerPicture.PlayerName.Text = plr.Name
-- Should go here
template.Parent = playerListFrame.PlayerHolder
end
if #game.Players:GetPlayers() >= 7 then
playerListFrame.PlayerHolder.CanvasSize = UDim2.new(0,0,1.05 + ((#game.Players:GetPlayers()-7) * .15),0)
else
playerListFrame.PlayerHolder.CanvasSize = UDim2.new(0,0,0,0)
end
end
I just want, to facilitate player navigation, to get the player team color (Exemple the player is in the red team, the color will be red, if he’s in blue, it’ll be blue, etc…)
How can I do that