Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
1game.ReplicatedStorage.test:WaitForChild("Part")
2local part = game.ReplicatedStorage.test.Part
3while true do
4    wait(2)
5    part:Clone()
6    part.Parent = game.Workspace
7end

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

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

try this:

1game.ReplicatedStorage.test:WaitForChild("Part")
2local part = game.ReplicatedStorage.test.Part
3while true do
4    wait(2)
5   local clone =  part:Clone()
6    clone.Parent = game.Workspace
7end

**or try this : **

1game.ReplicatedStorage.test:WaitForChild("Part")
2local part = game.ReplicatedStorage.test.Part
3while true do
4    wait(2)
5    part:Clone().Parent = game.Workspace
6end
0
its the same :D itz_rennox 412 — 5y
0
Thanks, the first code worked :D MartinFrog 6 — 5y
Ad

Answer this question