Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

If part is within certain x,y,z value then?

Sorry, but don't really have any code, although I am presuming it will involve Magnitude - So basically if a brick is in a certain area then it will continue the code, or whatever, this explains it a bit better:

http://prntscr.com/az13kp

2 answers

It could be as simple as making sure that the part's xyz positions are between two numbers.

if part.Position.Y < 100 and part.Position.Y > 0 --cannot be higher than 100 or lower than 0

You could also pick a single point and check how many studs your part is away from that. This would probably be cleaner than the aforementioned solution.

if (point - part.Position).magnitude < 100 then

As lucas points out, you could also use Region3.

This discussion is preserved as it was. New answers, comments, and votes are closed.