Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Team income error?

team_income = {}

team_income["Camo"] = 20
team_income["White"] = 1000
INCOME_TIMER = 1

while (true) do
    for index, player in pairs(game.Players:GetPlayers()) do
        
        print(player.Name)
        if player.Neutral == false  then
            player.cash.Value = player.cash.Value + team_income[player.TeamColor.Name] -- replace player.cash.value with whatever holds the players money
        end
    end
    wait(INCOME_TIMER)
end

I keep getting a "cash is not a valid member of player" error. How do I fix it?

1 comment

2

Is the cash stat shown on the leaderboard?

1 answer

Unless you have a variable that states "Cash" is a value of the Leaderboard, it won't work.

This discussion is preserved as it was. New answers, comments, and votes are closed.