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

Can you run 2 or more ignore lists with FindPartOnRayWithIgnoreList?

Asked by
xnocs 7
4 years ago

Is it possible to run 2 or more ignore lists with FindPartOnRayWithIgnoreList, I tried everything i could think of.

Example:

workspace:FindPartOnRayWithIgnoreList(ray, list1, list2)
0
I can't see why you'd need to. Why can't you put everything into 1 list? LukeSmasher 619 — 4y
0
Make a new list and combine the 2 lists in the new one, and put that inside of the function. Nowaha 459 — 4y
0
This gives me an error, "Unable to cast value to object" xnocs 7 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You could do something like this to combine two lists/tables into one.

local table1 = {4,5,6}
local table2 = {1,2,3}
for i,v in pairs(table1) do
    table.insert(table2,#table2 + 1,v)
end

for i,v in pairs(table2) do -- this just prints the components of table2
    print(v)
end

Output:

1

2

3

4

5

6

Ad

Answer this question