Ive got multiple leaderstats in the game which work fine, however when adding a new one I get this error message;
With this being the line in question;
This is where the leaderstat level is made:
Ive got multiple leaderstats in the game which work fine, however when adding a new one I get this error message;
With this being the line in question;
This is where the leaderstat level is made:
Out of curiosity what is levelData currently defined as?
Just removing .Value
should work. The error says you’re trying to index a number, so that means levelData already represents the value you’re looking for. In this case you would only need .Value
if your variable represented a NumberValue object.
That worked (as well as for the xp) though im curious as to why its the case for those 2 stats and not the rest which are all the same
All those work with no errors
Check how you’re saving the stats in DataStore. In levelData you might be saving just the number but for the others you might be saving the actual object of the value.