How would I get within a player that's located on a variable?

if moneytype == "Bank" then
		game.Players.(playervariable).PlayerStats.CashOnHand.Value + amount

How would I get around that, as it doesn’t work, as in using a variable and accessing it through game.Players?

game.Players[playervariable].PlayerStats.CashOnHand.Value = game.Players[playervariable].PlayerStats.CashOnHand.Value + amount

I wasn’t exactly sure what you were talking about.

1 Like