c = script.Parent:getChildren()
for a = 1, #c do
if c[a].Name ~= "Handle" and c[a].className == "Part" then
value = Instance.new("CFrameValue")
value.Parent = script.Parent.Handle
value.Name = (c[a].Name.."CF")
value.Value = c[a].CFrame:inverse()*script.Parent.Handle.CFrame
end
end
function weld()
c = script.Parent:getChildren()
for a = 1, #c do
if c[a].className == "Part" and c[a].Name ~= "Handle" then
weld = Instance.new("Weld")
weld.Parent = script.Parent.Handle
weld.Part0 = weld.Parent
weld.Part1 = c[a]
weld.C1 = script.Parent.Handle[c[a].Name.."CF"].Value
end
end
end
script.Parent.Equipped:connect(weld)
weld()
if c[a].Name ~= "Hole" and c[a].className == "Part" then
value = Instance.new("CFrameValue")
value.Parent = script.Parent.Handle
value.Name = (c[a].Name.."CF")
value.Value = c[a].CFrame:inverse()*script.Parent.Handle.CFrame
end
end
function weld()
c = script.Parent:getChildren()
for a = 1, #c do
if c[a].className == "Part" and c[a].Name ~= "Hole" then
weld = Instance.new("Weld")
weld.Parent = script.Parent.Handle
weld.Part0 = weld.Parent
weld.Part1 = c[a]
weld.C1 = script.Parent.Handle[c[a].Name.."CF"].Value
end
end
end
script.Parent.Equipped:connect(weld)
weld()
if c[a].Name ~= "Part" and c[a].className == "Part" then
value = Instance.new("CFrameValue")
value.Parent = script.Parent.Handle
value.Name = (c[a].Name.."CF")
value.Value = c[a].CFrame:inverse()*script.Parent.Handle.CFrame
end
end
function weld()
c = script.Parent:getChildren()
for a = 1, #c do
if c[a].className == "Part" and c[a].Name ~= "Part" then
weld = Instance.new("Weld")
weld.Parent = script.Parent.Handle
weld.Part0 = weld.Parent
weld.Part1 = c[a]
weld.C1 = script.Parent.Handle[c[a].Name.."CF"].Value
end
end
end
script.Parent.Equipped:connect(weld)
weld()
if c[a].Name ~= "Brick" and c[a].className == "Part" then
value = Instance.new("CFrameValue")
value.Parent = script.Parent.Handle
value.Name = (c[a].Name.."CF")
value.Value = c[a].CFrame:inverse()*script.Parent.Handle.CFrame
end
end
function weld()
c = script.Parent:getChildren()
for a = 1, #c do
if c[a].className == "Part" and c[a].Name ~= "Brick" then
weld = Instance.new("Weld")
weld.Parent = script.Parent.Handle
weld.Part0 = weld.Parent
weld.Part1 = c[a]
weld.C1 = script.Parent.Handle[c[a].Name.."CF"].Value
end
end
end
script.Parent.Equipped:connect(weld)
weld()
--Assuming the code you have is correct, try this.
|