Hey everyone-- So today I am trying to spawn in a model from lighting, and then use the MoveTo function to move the model to the correct position. The problem occurs when I click the button that begins the functions. The Model spawns just fine and goes to the correct position but then something goes wrong with the Welding script and it falls apart and is unusable. I know the problem is with the MoveTo function and everything works smoothly when I run it in solo mode in studio. Any help would be enormously appreciated. I've included the spawn-in script and the weld script.
Spawn Script
local debounce = false
local everything = {model}
local names = {model}
local children = game.Lighting:children()
for i=1,#children do
if (children[i].Name == "RowBoat") then
table.insert(everything, children[i]:clone())
table.insert(names, children[i].Name)
end
end
------------------------------------------------------------------------------
function regen()
if game.Workspace.Slot1.Value == 0 then
wait(2)
for i=1,#everything do
game.Lighting:findFirstChild(names[i]):clone()
new_thing = everything[i]:clone()
new_thing.Parent = game.Workspace
new_thing:makeJoints()
new_thing:MoveTo (Vector3.new(0,5,70))--This is the MoveTo stuffins
new_thing.VehicleSeat.Position = Vector3.new(-2.1,17.1,0)
end
else if game.Workspace.Slot2.Value == 0 then
wait(2)
for i=1,#everything do
game.Lighting:findFirstChild(names[i]):clone()
new_thing = everything[i]:clone()
new_thing.Parent = game.Workspace
new_thing:makeJoints()
new_thing:MoveTo (Vector3.new(0,5,130))
new_thing.VehicleSeat.Position = Vector3.new(-2.1,17.1,50)
end
else
return
end
end
end
script.Parent.MouseButton1Down:connect(regen)
Weld 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 == "Seat") or (A.className == "WedgePart") or (A.className == "CornerWedgePart") or (A.className == "VehicleSeat") 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()
NEWEST UPDATE: I just changed a script to a regular script instead of a local one. All is well in the world again.

2 comments
Any help? I am thinking about just anchoring the model, moving it over, then enabling the weld script and unachoring the model.
This I found out, does not work.