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

Clone() in a while true do loop is not working?

game.ReplicatedStorage.test:WaitForChild("Part")
local part = game.ReplicatedStorage.test.Part
while true do
	wait(2)
	part:Clone()
	part.Parent = game.Workspace
end

Test is just a folder in the replicatedstorage. What it does for some reason is just take the part out of the replicatedstorage into the workspace instead of cloning it. What did i do wrong?

1 answer

✓ Accepted answer

try this:

game.ReplicatedStorage.test:WaitForChild("Part")
local part = game.ReplicatedStorage.test.Part
while true do
    wait(2)
   local clone =  part:Clone()
    clone.Parent = game.Workspace
end

**or try this : **

game.ReplicatedStorage.test:WaitForChild("Part")
local part = game.ReplicatedStorage.test.Part
while true do
    wait(2)
    part:Clone().Parent = game.Workspace
end

2 comments

0

its the same :D

0

Thanks, the first code worked :D

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