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

How do i create clones from models from serverstorage that puts itself to workspace?

Asked by 4 years ago

Im making a game where you collect coins underwater and i want to know how to clone a model from serverstorage and i want to clone to put itself in workspace.

1 answer

Log in to vote
1
Answered by
palav 104
4 years ago
Edited 4 years ago

Alright, so let's say you have a model named Coin that has some parts in it.

After that, let's clone the model and set it's primary part, in case for whatever reason the primary part property didn't get copied over. In this case I assume that the primary part is called CoinBase.

local ModelClone = game.ServerStorage:WaitForChild("Coin"):Clone()
ModelClone.PrimaryPart = ModelClone.CoinBase

Now we have the clone of the model, so the first part of your question is done. Next, let's position and parent this model.

ModelClone:SetPrimaryPartCFrame(Whatever your cframe is)
ModelClone.parent = game.workspace

That should be it then.

Ad

Answer this question