whenever I try to add money or a win to my leaderboard, the output says "attempt to call a userdata value". My code is game.Players(vals.Winner.Value).leaderstats.Money.Value = game.Players[vals.Winner.Value].leaderstats.Money.Value +100 Am I doing anything wrong?
✓ ANSWER ACCEPTED
what does "attempt to call a userdata value" mean??
2 answers
✓ Accepted answer
Its because your using normal brackets instead of the square ones the first time you try to reference vals.Winner.Value. It thinks your calling a function.
Hello. It errors because you weren't using square brackets, and game.Players() will make the game think you're trying to call game.Players just as if it was a function. Try this:
game.Players[vals.Winner.Value].leaderstats.Money.Value = game.Players[vals.Winner.Value].leaderstats.Money.Value +100
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Attempt to call a user-data value just means that you're trying to call something that isn't a function.