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

replicatedstorage deletes in loop?

Asked by 5 years ago
local ee = game.ReplicatedStorage.eee:Clone()

while true do
    ee.CFrame = script.Parent.CFrame*CFrame.new(12,12,0)
    ee.Parent = workspace
    wait(5)
end

every 5 seconds, the replicated storage item deletes and is replaced with a new one, but I want infinite parts to spawn

1 answer

Log in to vote
0
Answered by 5 years ago

For that you would need to call :Clone() inside your loop instead so each time it gets executed it will create a copy, rather than create a single copy at the start of your code.

Modified code:

while true do
    local ee = game.ReplicatedStorage.eee:Clone()
    ee.CFrame = script.Parent.CFrame*CFrame.new(12,12,0)
    ee.Parent = workspace
    wait(5)
end
0
thank you spunkworks 110 — 5y
0
no problem :) Le_Teapots 913 — 5y
Ad

Answer this question