How to tell if a player is inside a part?

Seen some threads about this but using Region3 or something like that, but when i try it myself it says its deprecated. and how would i tell if a player is not in the part

What was that deprecated code?

You can use worldroot:getpartsinpart() or worldroot:getpartboundsinbox() + more on the wiki.

My one was inspired by this.

1 Like

Using GetPartsInPart(), how would I tell if a player is touching the part?

if(part.Name == "HumanoidRootPart") then -- if the HRP is inside the wall - they're definitely exploiting.

Then part.Parent. This reads to Player’s character and FindPlayerFromCharacter’s turn.

Getpartsinpart is pretty resource heavy, but it returns a table of parts. All you would do is loop through the table and check if game.Players:getplayerfromcharacter(part.Parent) then there is a player inside.