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:
COMMUNITY QUESTION
If part is within certain x,y,z value then?
2 answers
You could use FindPartsInRegion3 http://wiki.roblox.com/index.php?title=API:Class/Workspace/FindPartsInRegion3 And make the Region3 that area you want the parts in http://wiki.roblox.com/index.php?title=API:Region3&redirect=no
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.
