generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Proper way to use ":FindPartsInRegion3" ?

Previous Thread :: Next Thread 
superior is not online. superior
Joined: 13 Apr 2008
Total Posts: 1662
03 Sep 2011 09:49 PM
map = {}
local region = Region3.new(workspace.Base.Position-workspace.Base.Size/2, workspace.Base.Position+workspace.Base.Size/2)
local parts = workspace:FindPartsInRegion3(region, workspace.Base, 50)
table.insert(map, parts)
for i = 1, #map do
print(map[i])
end

This prints "table: 1EB20A70", or some other random numbers. :/ Am I doing this right? Sorry, I'm new to Region3 stuff.
Report Abuse
DrSprinkles is not online. DrSprinkles
Joined: 27 Aug 2011
Total Posts: 457
03 Sep 2011 09:50 PM
Orly? New function?
Didn't hear of it.
Probably because I don't even get on Roblox, I just forum.
Am I talking to myself?
Report Abuse
superior is not online. superior
Joined: 13 Apr 2008
Total Posts: 1662
03 Sep 2011 09:51 PM
Yup.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
03 Sep 2011 09:51 PM
@Dr

Yes

:FindPartsInRegion3 returns a table with up to the third argument of the function. (max 100)

You have to loop through the table.
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
03 Sep 2011 09:52 PM
FindPartsInRegion3 returns a table.
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
03 Sep 2011 09:53 PM
@swm
OMG Y U EARLY POSTED?!
Report Abuse
superior is not online. superior
Joined: 13 Apr 2008
Total Posts: 1662
03 Sep 2011 09:54 PM
Ah I see. So I would just replace "...#map do" with "...#parts do". Thanks.
Report Abuse
DrSprinkles is not online. DrSprinkles
Joined: 27 Aug 2011
Total Posts: 457
03 Sep 2011 09:54 PM
@Spectrum
I miss you.
You were the funniest person in the world < / 3
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
03 Sep 2011 09:54 PM
@Spectrum

I was going 88 MPH when I posted, sorry 'bout that.

If you don't get the reference... just don't ask.

so like.

table = workspace:FindPartsInRegion3(...)
for i, v in pairs(table) do
-- Do stuff
end
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
03 Sep 2011 09:56 PM
"I miss you.
You were the funniest person in the world < / 3"

I moved to Scripters... o-o

@swmaniac
That reminds me the 50mph men... Hilarious end.
Report Abuse
DrSprinkles is not online. DrSprinkles
Joined: 27 Aug 2011
Total Posts: 457
03 Sep 2011 09:57 PM
""I miss you.
You were the funniest person in the world < / 3"

I moved to Scripters... o-o

@swmaniac
That reminds me the 50mph men... Hilarious end."
UMG WHY U MOVE?
Report Abuse
superior is not online. superior
Joined: 13 Apr 2008
Total Posts: 1662
03 Sep 2011 09:58 PM
@swm, that's what I clearly just stated.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image