I'm currently having a problem with my weld script, and the problem is that the script welds for only one part and doesn't weld any other, even though it's using a for loop. I think the root of the problem is that when it welds, it only welds the first child because the "i" is identified as a one, so the script welds the first child only. When I change the "i" into a different number, such as 3, it welds the third child. I don't exactly know how to fix this issue since I didn't originally create this script. Anyone know how to fix this problem?
function weld(x,y)
weld = Instance.new("Weld")
weld.Part0 = x
weld.Part1 = y
local CJ = CFrame.new(x.Position)
local C0 = x.CFrame:inverse()*CJ
local C1 = y.CFrame:inverse()*CJ
weld.C0 = C0
weld.C1 = C1
weld.Parent = x
end
function Get(A)
if A.className == "Part" or A.className == "WedgePart" or A.className == "UnionOperation" then
weld(script.Parent.Part4, A)
A.Anchored = false
else
local child = script.Parent:GetChildren() --Mainly This Code
for i = 1, #child do
Get(child[i])
end
end
end
function Finale()
Get(script.Parent)
end
Finale()

1 comment
anyone?