FatalizerJoin Date: 2011-08-28 Post Count: 1520 |
This is my script;
for _, v in pairs (Workspace:GetChildren()) do
if v:IsA("BasePart") then
v:BreakJoints()
end
end
I want every brick in the Workspace and Workspace models to breakjoint, it just won't work , does anyone got a fix ? |
|
FatalizerJoin Date: 2011-08-28 Post Count: 1520 |
Have a fix* |
|
|
for _, v in pairs (Workspace:GetChildren()) do
if v:IsA("Model") then
v:BreakJoints()
end
end
~I'm an Angry Llama~ |
|
|
function break(model)
for _, v in pairs (model) do
if #v:GetChildren() >=1 then break(v) end
if v:IsA("Model") then
v:BreakJoints()
end
end
end
break(workspace)
BreakJoints, EVERYTHING in workspace
~I'm an Angry Llama~ |
|
FatalizerJoin Date: 2011-08-28 Post Count: 1520 |
The first line of the script;
function break(model) -- will error |
|
FatalizerJoin Date: 2011-08-28 Post Count: 1520 |
Bump |
|
|
Did mine not work?
Fixed:?
function breakk(model)
for _, v in pairs (model) do
if #v:GetChildren() >=1 then breakk(v) end
if v:IsA("Model") then
v:BreakJoints()
end
end
end
breakk(workspace)
~I'm an Angry Llama~ |
|
|
Kiwi here is your error:
for _, v in pairs (model) do
You assigned model as Workspace, but it has to be a table |
|
ScrippaJoin Date: 2011-12-25 Post Count: 20289 |
for _,v in pairs(Workspace:children()) do
if v:IsA("BasePart") or v:IsA("Model") then
v:BreakJoints()
end |
|
FatalizerJoin Date: 2011-08-28 Post Count: 1520 |
You forgot another "end" , but it works. Thanks good Sir. |
|
|
OH RIGHT
how silly of me haha
~I'm an Angry Llama~ |
|