I just need to know how to move models with scripts
Obbys = {"Spin Tube","Ice Path","Laser1"} function Cool() local Obby = game.Lighting:FindFirstChild(Obbys[math.random(1,3)]) local Boo = Obby:Clone() Boo.Parent = game.Workspace Boo:MakeJoints() Boo.PrimaryPart = Boo.BaseArea Boo:SetPrimaryPartCFrame(script.Parent.Parent.BaseArea.CFrame + CFrame.new(56,0,0)) script:Destroy() end script.Parent.Touched:connect(Cool)
Errors:
Workspace.Model.SpawnLocation.Script:9: bad argument #2 to '?' (Vector3 expected, got CFrame)
Okay, first you should tab your code.
Now, you real problem is your CFrame math. You cannot add a CFrame to a CFrame. You must multiply which will still do the same thing you want.
So bellow is the fixed code.
Obbys = {"Spin Tube","Ice Path","Laser1"} function Cool() local Obby = game.Lighting:FindFirstChild(Obbys[math.random(1,3)]) local Boo = Obby:Clone() Boo.Parent = game.Workspace Boo:MakeJoints() Boo.PrimaryPart = Boo.BaseArea Boo:SetPrimaryPartCFrame(script.Parent.Parent.BaseArea.CFrame * CFrame.new(56,0,0)) script:Destroy() end script.Parent.Touched:connect(Cool)