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

replicatedstorage deletes in loop?

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

✓ Accepted answer

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

2 comments

0

thank you

0

no problem :)

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