local c = coroutine.create(function()
while task.wait(0.05) do
SpawnRainingBomb()
end
end)
coroutine.resume(c)
task.wait(DInfo.Time)
coroutine.yield()
c = nil
print('Disaster Over')
I have this inside a function
full function
function module.StartDisaster(disasterID, DInfo)
if disasterID == 1 then
print('Raining Bombs')
local c = coroutine.create(function()
while task.wait(0.05) do
SpawnRainingBomb()
end
end)
coroutine.resume(c)
task.wait(DInfo.Time)
coroutine.yield()
c = nil
print('Disaster Over')
end
end
but it never ends and i don’t know why
can someone help?? thank you
It also yields where the function is being ran
i have never used coroutine before