#Using Model:Clone() twice removes first clone. How to fix?

5 messages · Page 1 of 1 (latest)

lone lava
#

Hello all! So as the title suggests, I'm trying to crate multiple clones of a model within the scene. This is my code I'm using:

local function placeBuilding(Player, b, c)
    local placed_building = b:Clone()
    b:PivotTo(c)
    b.Parent = game.Workspace
    return b
end

In this case, b is the model to be cloned (originally found in the Replicated Storage), and c is the Cframe. It works the first time, spawning the clone in the correct position, but if I try to repeat the function, it gets rid of the first clone and places a new one. What am I missing here?

(I should also clarify this is all being performed in a regular server script)

hollow geode
#

you set placed_building to b:Clone()
but then you do stuff to b instead of the cloned b??

lone lava
#

Shit

#

Sometimes it just takes a second set of eyes lol