✓ Accepted answer
To find where a part is positioned relative to another part you can use their CFrames to find an offset. This offset is the relative position and rotation between those two objects, so if you were to translate A by the offset between A and B, you'd get B. It's a bit hard to understand at first but once you start using it more it starts making more sense.
The CFrame object already has a function to find this offset; ToObjectSpace().
Here's an example of how it can be used, and how it can solve your problem.
local c0 = workspace.Part0.CFrame
local c1 = workspace.Part1.CFrame
local offset = c0:ToObjectSpace(c1)
print(offset.Position.Y)
2 comments
using the same logic lmao. What do you mean local to the part? If you want to know if a part is on top / below, rely on the y axis like you demonstrated
What I want to do is like "if part.position <= script.parent.CFrame.y then"