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.
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.
although 2 years ago but the solution is just using
(there might be spelling issues im currently not on studio)
workspace:GetPartsInPart(Part, Params) -- the Part is just basically the region that you want to check if the player is inside, (or you can just use GetPartsInRegion if you dont want any actual part for the region)
and then just check if one of the parts’ parent have a humanoid, and if you want to check for the local player just check if the parts’ parent that has humanoid’s name is the same as the local player’s name