Chrapnel
|
  |
| Joined: 01 Feb 2014 |
| Total Posts: 951 |
|
|
| 24 Apr 2015 07:54 PM |
function unanchor(tab) for k,v in ipairs(tab) do if v:IsA("BasePart") then v.Anchored = false end end end unanchor({base, part})
Error: 10:51:40.455 - Workspace.New.newWeld:4: bad argument #1 to 'ipairs' (table expected, got userdata)
What am I doing wrong? |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2015 08:00 PM |
| You did not define the parent of "base" and "part" |
|
|
| Report Abuse |
|
|
Chrapnel
|
  |
| Joined: 01 Feb 2014 |
| Total Posts: 951 |
|
|
| 24 Apr 2015 08:02 PM |
all variables defined. did you even read the error? |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2015 08:03 PM |
| when you said unanchor({base,part}) you never defined "base" and "part". So it should be {workspace.base,workspace.part} |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2015 08:06 PM |
This... this is why... oh my god.
Fishguy please leave, we don't need your help. |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2015 08:08 PM |
function unanchor(parts) if type(parts) == "table" then for _,part in next, parts do if part:IsA("Part") then part.Anchored = true end end end end
unanchor({base, part}) |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Apr 2015 08:09 PM |
It worked for me in studio just fine.
function unanchor(tab) for k,v in ipairs(tab) do if v:IsA("BasePart") then v.Anchored = false end end end unanchor {workspace.Part0, workspace.Part1} |
|
|
| Report Abuse |
|
|