BoolValue is not valid member of Player

Hello.

I am trying to use a BoolValue created in a player when they join to check if they have claimed a room in a game I am creating. My intention is to set it to false by default, and then when a door is clicked it is changed to true to prevent them from claiming more than 1 room.

My problem is that, when the door is clicked, I get an error stating " claimedDorm is not a valid member of Player “Players.lazymarkers”" and I don’t know why. It’s the exact same name, I am sure it is in my Player instance, I have a WaitForChild involved to make sure it exists, yet it apparently doesn’t exist.

The script for the door worked perfectly fine before I added the claimedDorm check.

Example of my script:
image
The error:

Please help :stuck_out_tongue:

first off, why are you doing game.Players[player.Name] when you can just do player second, we will need to see the script that adds the claimedDorm value

I did [player.Name] because I was looking for any possible place the error could be so I did that just to be safe.

Here’s what creates the BoolValue:

And to make sure it’s in the player when the game is running:

Oh I got it, change the line that errors to
player.claimedDorm.Value = true

1 Like

Oh. I was looking in the complete wrong line for the error.

Yeah, that fixed it lol. Thanks for catching it.

1 Like