--[[Replace the word 'time' with whatever leaderstat you want, and adjust the teamValue table to your team colors and required values.]]
local teamValue = {
[1] = BrickColor.new("Bright red");
[10] = BrickColor.new("Bright green");
[50] = BrickColor.new("Bright blue");
}
game.Players.PlayerAdded:connect(function(player)
player:WaitForChild("leaderstats", math.huge):WaitForChild("time", math.huge).Changed:Connect(function(value)
if (teamValue[value]) then
player.TeamColor = teamValue[value]
end
return(nil);
end
return (nil);
end) |