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

The cakes are multiply-ing by the second. what do i do?

--Script
while true do
	wait(3)
	local SmallCake = script.Parent
	local clonedSmall = SmallCake:Clone()
	clonedSmall.Parent = game.Workspace.Cakes.ClonedCakes
	clonedSmall.Position = Vector3.new(-280.727, 831.309, -232.018) -- Where the cake will spawn
	
end

This is a script I made. So if i 'Play', or 'Run', this will create cakes falling out from the stove. But each time, the cakes get multiplied and I just waited like 30 sec but about 100 cakes are coming out on the stove every 3 sec! help me. *Supposed to come 1 cake in 3 sec

local sec = 'second' :D

1 comment

2

The script is inside the Cake you're cloning. This in turn will create more scripts that have a while loop that clone's the script too. Smite me if i'm wrong.

1 answer

✓ Accepted answer

I'm pretty sure you are cloning the script. Indicating from the fact you are cloning script.Parent. You need to make sure to not clone the actual script if you do it will keep multiplying constantly over and over again.

3 comments

1

Accept this as I commented at the same time.

0

You commented 2 minutes after i did ;) Kappa

0

Thanks guys! I forgot about that

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