Detecting amount of players on a part

Thanks for this, so is the Region3 where the player stands for this to work? If so, how do you modify regions and do you have any recourses that may help? Thank you so much

This is a great video that can help you.

1 Like

It’s much easier to understand and region3 is mainly use to handle multiple parts that are inside the region.

I’ve also make it +7 in the Y axis presumably if you are using it for a button, you can adjust it according to your preference.

1 Like

You scripted the whole thing wrong. This isn’t how it should work.

You should make it so that the part uses the GetTouchingParts() function repetitively, then use a for loop to loop through the parts that touched the part, check their parent, if their parent is a player through Players:GetPlayerFromCharacter(hit.Parent), then add them into a table, then make sure that if the other part is also a parent of the player’s character, skip that part and don’t add multiple player instances in the table.

I’d call my relevant functions after the final player had been added; however, it depends what you’re wanting to do and how you will do it. Also checking to make sure players still exist on the part, I would use the TouchEnded function of a part.

1 Like