How to detect if part in bounds

Hello,
I want to find an easier alternative than just to

if part.Position.X>part2.Position.X-part2.Size.X/2 then
if part.Position.X<part2.Position.X+part2.Size.X/2 then
if part.Position.Z>part2.Position.Z-part2.Size.Z/2 then
if part.Position.Z<part2.Position.Z+part2.Size.Z/2 then
-- blah blah blah
end
end
end
end

- Br, iSyriux

This cool solution should work which uses CFrames, loops, and tables, just reuse the variables accordingly.

local hitbox = part2 --block part
local point = part.Position--Vector3
2 Likes