I am in the process of creating a city based game and I am not sure how to make it so if you are a certain TeamColor then you get a certain amount of money. I have tried editing the Leaderboard's artice on the wiki's script.
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Model")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Money"
money.Value = 0
money.Parent = leaderstats
end)
if game.Players.LocalPlayer.TeamColor = "Pearl"
while wait(5) do
for _, player in ipairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats") then
player.leaderstats.Money.Value = player.leaderstats.Money.Value + 1
end
end
end
I am sorry if the code does not work I am not sure how to do the code snippets so if you could tell me how if this is wrong then please! :)

2 comments
I just put in " if game.Players.LocalPlayer.TeamColor = "Pearl" on line 10
Edited for code block.