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

Cant copy a model from a table how to fix?

Hello, I am making a Tower Of Hell kinda copy. I am making randomized stages I can't seem to figure out how to clone the stages.

Can somebody show me how to fix it?

Code:

local Selector = math.random(1, 3)
local Stages = {game.ReplicatedStorage.Stage001, game.ReplicatedStorage.Stage002, game.ReplicatedStorage.Stage003}
local SelectedStage1 = Stages[Selector]

SelectedStage1:Clone

2 comments

0

:Clone()

0

still doesnt work

1 answer

✓ Accepted answer

You need to use Instance:Clone() to correctly clone a part, also, you forgot to set the parent of the cloned part:

local Selector = math.random(1, 3)
local Stages = {game.ReplicatedStorage.Stage001, game.ReplicatedStorage.Stage002, game.ReplicatedStorage.Stage003}
local SelectedStage1 = Stages[Selector]

local clone = SelectedStage1:Clone() -- You need to use :Clone() to make it clone the object
clone.Parent = workspace

If this answers your question, place mark the answer as accepted

2 comments

0

it still doesnt

0

oh wait it does

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