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
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

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

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
0
its the same :D itz_rennox 412 — 5y
0
Thanks, the first code worked :D MartinFrog 6 — 5y
Ad

Answer this question