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

Team income error?

Asked by 9 years ago
01team_income = {}
02 
03team_income["Camo"] = 20
04team_income["White"] = 1000
05INCOME_TIMER = 1
06 
07while (true) do
08    for index, player in pairs(game.Players:GetPlayers()) do
09 
10        print(player.Name)
11        if player.Neutral == false  then
12            player.cash.Value = player.cash.Value + team_income[player.TeamColor.Name] -- replace player.cash.value with whatever holds the players money
13        end
14    end
15    wait(INCOME_TIMER)
16end

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 — 9y

1 answer

Log in to vote
3
Answered by 9 years ago

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

Ad

Answer this question