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

Why won't it dupe?

When I activate this script:

local resources = game.Lighting["Iron Ore"]
local drop = true
local clone = resources:clone()
function dropfunc()
		resources:clone()
		resources.Parent = script.Parent.Parent
		wait(1)
		script.Parent.Parent["Iron Ore"].Position = script.Parent.Position
end
while drop == true do
dropfunc()
wait(10)
end

All it does is moves it to the work space and repeatedly drops it to the ground from the height of the brick. NOTE: I need to copy the whole thing because the brick contains values. I cannot just make the workspace create a new part, since it would be too complex.

2 answers

What you want to do is clone the model, and then use that as a reference for the rest of the cloned models. So essentially, every time you regenerate the model, you have to clone the backup clone and then place that in the workspace. So what you have to do is replace

resources:clone()
resources.Parent = script.Parent.Parent

With this

local Duplicate = clone:Clone() --This is cloning the "clone" that you made at the beginning of the script
Duplicate.Parent = script.Parent.Parent

Hope this helped!

Replace

        resources:clone()
        resources.Parent = script.Parent.Parent

with

        local clonedResources = resources:clone()
        clonedResources.Parent = script.Parent.Parent

2 comments

0

Still wont work

0

It only duplicated it from the lighting one time

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