Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I loop and find all bricks of a certain name within a certain magnitude?

Asked by 8 years ago
Edited 8 years ago

How can I loop and find all bricks of a certain name within a certain magnitude?

Dont get me wrong, I might seem like a novice, but I know alot about programming, I just cant figure this out:

I need to be able to have a while loop that returns all blocks into an array that have the name say "Node" and that are with in the magnitude / distance of say 40 studs.

I can work out performance later, but I just don't know how to put something with a specific name AND within distance into an array. I would give some pseudo code or what I got but I just don't know how to continue without this essential piece of code.

I'm thinking maybe I could take an pre built array of all the Nodes then just loop through the entire thing and check locations, but that would create a tick delay.

1
What you suggested (about looping through again to check for locations) is what I would do, although there may be a better way that I am unaware of. cfiredog 274 — 8y
0
Thanks. I would upvote your comment but I dont have any reputation points lol. If you want to see what I am using it for you can look at @scorchstudios on twitter. Might help, idk plasma_node 343 — 8y
0
Up-voting comments doesn't give rep. It's basically useless. It does however make the other person feel nice. I'll do it for you. User#11440 120 — 8y
0
Thanks. I think your right, Ill just do the locations thing. plasma_node 343 — 8y

Answer this question