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

what does "attempt to call a userdata value" mean??

Asked by
Dekishi 12
4 years ago

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?

0
Attempt to call a user-data value just means that you're trying to call something that isn't a function. SilentsReplacement 468 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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.

Ad
Log in to vote
0
Answered by 4 years ago

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

Answer this question