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

attempting to finds parts in a region prints a table with random numbers instead of parts?

local ignorelist = script.Parent.Part,script.Parent.RegionPart

local center = script.Parent.Part.Position

local size = script.Parent.RegionPart.Position

local region = Region3.new((center - size/2),(center + size/2))

  

local parts = workspace:FindPartsInRegion3(region,ignorelist)

  

while true do

wait(1)

print(parts)

end

Im new to region3 so I dont know too much about it, but im trying to create a region3 area with a center point. and then Im trying to print whatever is inside of that region. but instead of getting a part name I get this:

table: 0000027F00EF2C40

2 comments

0

You're just printing out the table, use iteration to iterate through it and then print out what's inside.

0

how can I do that? I looked up "Tables" on the wiki and im not quite sure how this can be used with my current setup.

1 answer

✓ Accepted answer

What is "table: 0000027F00EF2C40"?

This is the table's hexadecimal memory address. This is perfectly normal. If you want to print the elements of the table, use table.unpack.

print(unpack(parts));

There is also table.concat:

print(table.concat({'a', 'b', 'c', 'd'}, ", "));

Where ", " is your delimiter that separates each element. It can be anything, even a semicolon (;) for example.

But for that last solution it will not work in this case since it can error if a non-string or non-number is encountered

1 comment

0

while I was waiting for an answer I found another solution to fit my needs. instead of using region3 to get parts in an area I found out I can just use GetTouchingParts(). but thank you for this answer just in case I need to use region3 in the future.

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