Make building system only work if you're inside your plot

Hello! I’ve just started programming, but I have a problem…

I have the placement system but I don’t know how to implement it in the house system, I would like the player to only be able to build in his house and nowhere else, how could I do it?

I’ve searched everywhere, tutorials, devforum posts, posts in other forums and I haven’t found anything about it, as I said at the beginning I don’t know much about programming so the developer hub is quite complicated.

Thanks.

1 Like

Here is a example placement system
There are some youtube tutorials as well you can look it up

3 Likes

You could check if the part that’s directly beneath it is part of a folder which contains the house. Or just use position checking, and if the player is in like, a 100x100 box, it allows building.

3 Likes

You could have a loop that keeps raycasting from the player humanoid to the ground while building mode is enabled(the ray should have the length of the house height+some offset) if the ray hits the player plot they’re inside their plot(you should use the whitelist filter and only add the plot to the whitelist, so other parts like character limbs and plot items are ignored by the ray).

I suggest you check resources like Intro to Raycasting and RaycastParams

2 Likes