Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why can't I clone models from server storage?

Asked by 7 years ago
Edited 7 years ago

I've been trying to create a bunch of the same model by copying one I have in ServerStorage.

Script in ServerScriptService works like this:

function CreateModel()
    newModel = game.ServerStorage.Model:clone()
    newModel .Parent = game.Workspace
    newModel .Position = Vector3.new(0,0,2)
end

However, this code does not create the part when it is run, unless it is a basic part. Is there a way to successfully clone models from ServerStorage?

0
There is a space before the ". H4X0MSYT 536 — 7y

1 answer

Log in to vote
0
Answered by
130363 67
7 years ago
Edited 7 years ago

If this is the whole script you'll need something to call that function like a script.Parent.ClickDetector.MouseClick:connect(onClicked). But you don't need something to activate it.

So, you'll use this:

local Service = game:GetService("ServerStorage")
local newModel = Service.Model

newModel:clone()
newModel.Parent = game.Workspace
newModel.Position = Vector3.new(0,0,2)

Ad

Answer this question