This code chooses a random position within a part, but it doesn’t account for rotation so even if the part is rotated it will act the same as if it was not rotated.
Part.Size.X, is the full width of the part. You want half that range in each direction if you want a point inside the part, no?
When you post-multiply your part CFrame by a CFrame that is pure translation, as Starception has done, the translation is in the part’s local coordinate space. So Part.CFrame * CFrame(x,y,z) is the same as:
No problem!
I completely drew a blank and @AllYourBlox’s reminded me that I needed to divide the size by two. Otherwise, it could go farther out past the part’s boundaries.
It might be doing what you need, but it’s not picking a point inside the part, that’s what I meant. I wasn’t sure what you actually wanted. The chance your random point is inside the part is only 12.5%, 1 out of 8 times.