#Function not being able to have multiple clones present at once

1 messages · Page 1 of 1 (latest)

tepid stag
#

So I am simulating the Doors heartbeat minigame, and when I try to make a clone of a heartbeat decal, it only makes one, then wait after that one is destroyed, then creates another one. I am trying to have it so then It keeps making clones, no matter if there is already one present or not. For some reason it only makes multiple at the same time if i set the clonedSide = nil right after the tween is played (I want to have the beats destroyed by the end, which i currently can't have if I want to beats to constantly show)

#

(with destroy)

#

(without destroy & w/ cloneSide = nil)

loud pelican
#

I think its because its waiting for HeartbeatStep to finish because you are running it synchronously. At the bottom maybe try this:
for i = 1, 2 do
if math.random(1,2) == 1 then
task.spawn(function() HeartbeatStep("Left") end)
else
task.spawn(function() HeartbeatStep("Right") end)
end
task.wait(0.5)
end