This post is old and made when I was extremely young and didn’t know anything of the time. This is basically the question and the solution:
player.leaderstats.Stages = 0
Stages in this scenario is a IntValue, which I assigned it to 0 which was a mistake on my part. But the error instead of telling it’s illegal or invalid, it decided to say that Stages is not a valid member of the leaderstats - which is false because the Stages - is indeed inside of the leaderstats.
The reason why this happens is that Lua thought Stages is a property inside the leaderstats and not a member inside the explorer, and properties are members aswell. Which gives:
Stages is not a valid member of Folder "game.Players.Xapelize.leaderstats"
Old post:
In a line of ServerScript, I did a little code mistake:
player.leaderstats.Stages = 0
And it gives the following error in this script:
Stages is not a valid member of Folder "game.Players.Xapelize.leaderstats"
For your information, Stages is an IntValue
I checked the script, and checked does Stages exists in server-sided when testing, so I was very confused so I made a script:
print(player:FindFirstChild("leaderstats"):FindFirstChild("Stages") ~= nil)
And, the result is false. After I realizing my code mistake, I changed it to this:
player.leaderstats.Stages.Value = 0
And it works perfectly fine. But, why the error code says Stages is not a valid member of leaderstats even Stages is inside leaderstats? The error code should be “Attempt to perform arithmetic on number and Instance”. Can anybody explain?
Oh by the way, tell me if the category is wrong, because I don’t see any “Roblox Studio bugs” in it. Thanks for reading ![]()