Ad
Log in to vote
0

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

Asked by 2 months ago
--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

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. xPolarium 846 — 2mo

1 answer

Log in to vote
1
Answered by 2 months ago

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.

1
Accept this as I commented at the same time. xPolarium 846 — 2mo
0
You commented 2 minutes after i did ;) Kappa casper123123123 359 — 2mo
0
Thanks guys! I forgot about that ComLBY_Dev 17 — 2mo
Ad

Answer this question