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

How to Multiple Clone an item?

I am trying to give price at least 10-15x. But how do I clone multiple times?

The script works fine, I just need to duplicate it. Should I add a lot of m = LOOT:Clone()?

local ReplicatedStorage = game.ReplicatedStorage
local LOOT = ReplicatedStorage:WaitForChild('BossLoot')
local DropperPart = script.Parent:WaitForChild('Head') 


while true do
	wait(5)
	 script.Parent.Humanoid.Died:Connect(function()
			print(script.Parent.Name .. " has died!")
		
		local m = LOOT:Clone()
m.Parent = DropperPart
game:GetService('Debris'):AddItem(LOOT,300)
 wait(20)
		script.Parent:Destroy()
		end)
end

3 comments

0

You can maybe make alot of "LOOT" in a group and clone the group instead of the singular item

0

Won't that lag the game? Im trying to save memory so people in old tech can play.

0

you can put lines 11 to 13 in a for loop with a wait so there wont be an abrupt lag

1 answer

Try this as the clone

for i = 1, y, 1 do
     Local m = LOOT:Clone() 
     m.Parent = DropperPart
     wait(0.1) 
end

This is a simple for loop. If you want to make the clone 10 times, then change the y to 10, if 15 times, then to 15 (for i = 1,15,1)

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