Getting error in output

Hey guys.
I am getting an error that is saying “leaderstats is not a valid member of Player “Players.maddiesswrld””, but the folder leaderstats is in the player, why am I getting this?

I know I’m making quite a bit of posts, just not used to working with this :sweat_smile:

Script:

game.Players.PlayerAdded:connect(function(player)
    local nextstage = workspace:WaitForChild("Stage"..(player.leaderstats.Stage.Value+1))
    local stage = workspace:WaitForChild(player.leaderstats.Stage.Value)
    wait()
    nextstage.BrickColor = BrickColor.new("Shamrock")       
end)

Folder:
image

game.Players.PlayerAdded:Connect(function(player)
    local nextstage = workspace:WaitForChild("Stage"..player.leaderstats.Stage.Value+=1)
    nextstage.BrickColor = BrickColor.new("Shamrock")       
end)

You’re probably not waitign for leaderstats to exist, try this

game.Players.PlayerAdded:Connect(function(player)
    local stats = player:WaitForChild("leaderstats")
    local nextstage = workspace:WaitForChild("Stage"..(stats.Stage.Value+1))
    nextstage.BrickColor = BrickColor.new("Shamrock")       
end)

Also you don’t really need to += in this case, that’s for adding something to a value and storing the result back into it, in this case, you just need the nextstage so just do + 1