Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Team income error?

Asked by 8 years ago
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?

2
Is the cash stat shown on the leaderboard? General_Scripter 425 — 8y

1 answer

Log in to vote
3
Answered by 8 years ago

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

Ad

Answer this question