toasterr
|
  |
| Joined: 14 Feb 2011 |
| Total Posts: 36 |
|
|
| 18 Dec 2012 08:20 PM |
how do i make this weld script unanchore a model right before adding welds?
script:
function Weld(x,y) local W = Instance.new("Weld") W.Part0 = x W.Part1 = y local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()*CJ local C1 = y.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = x end
function Get(A) if (A.className == "Part") or (A.className == "Part") then Weld(script.Parent.Engine, A) else local C = A:GetChildren() for i=1, #C do Get(C[i]) end end end
function Finale() Get(script.Parent) end
Finale() |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2012 08:24 PM |
for i,v in pairs(model) do if v:IsA("Part") then v.Anchored = true
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
toasterr
|
  |
| Joined: 14 Feb 2011 |
| Total Posts: 36 |
|
|
| 18 Dec 2012 08:27 PM |
| thanks but were do i put that part? |
|
|
| Report Abuse |
|
|
toasterr
|
  |
| Joined: 14 Feb 2011 |
| Total Posts: 36 |
|
| |
|
|
| 18 Dec 2012 08:43 PM |
you have to use recursive searching.
function recurse(o) for _, v in pairs(o:GetChildren()) do recurse(o) end o.Anchored = true end
¬ LuaLearners Elite/Teacher(+3) ♣ SHG Scripter Tier-2 |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2012 08:44 PM |
function recurse(o) for _, v in pairs(o:GetChildren()) do recurse(o) end o.Anchored = true end |
|
|
| Report Abuse |
|
|
toasterr
|
  |
| Joined: 14 Feb 2011 |
| Total Posts: 36 |
|
|
| 18 Dec 2012 08:47 PM |
| thanks but were do i put that part of the script also will it unanchore the moldel? because the model is anchored and has to be unanchored |
|
|
| Report Abuse |
|
|