Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to clone a model instead of a part?

So. i got this cloning script and when im trying to use a model instead of a part the output gives me an Vector3 expected error:

11:19:39.735 - Players.ObStactionD3stroy3r.PlayerGui.ScreenGui.Frame.LavaStage.TextButton.Sccrr:5: bad argument #1 to '?' (Vector3 expected, got nil)
11:19:39.736 - Stack Begin
11:19:39.736 - Script 'Players.ObStactionD3stroy3r.PlayerGui.ScreenGui.Frame.LavaStage.TextButton.Sccrr', Line 5 - global NewTycoonPart

Here's The Current Script

local CF = CFrame.new(0, 2, 0) -- Starting CFrame
 
function NewTycoonPart()
    local LavaStage = game.ServerStorage.LavaStage
	LavaStage:Clone().Parent = workspace
    LavaStage:GetChildren().CFrame = CF + Vector3.new(0, 0, 5) -- Add a Vector3 to the CFrame
    wait(0.2)
    CF = LavaStage:GetChildren().CFrame -- CFrame of the next part
end
 
script.Parent.MouseButton1Down:connect(function()
    NewTycoonPart()
end)

1 answer

To simplify use that should fix your problems too.

Model.PrimaryPart = Model.MainPart --[[Whatever part you want to use to CFrame ]]
Model:SetPrimaryPartCFrame(game.Workspace.MoveHere.CFrame)

This discussion is preserved as it was. New answers, comments, and votes are closed.