How do I make it so that the coroutines do not run self:Create at the same time? Currently they are all yielding for self.SpawnClear to become true. I need the coroutine as I want different flavours to be created simultaneously.
Code:
while true do
task.wait()
for flavour, amount in pairs(flavoursToDrop) do
print("loop")
coroutine.wrap(function()
for i = 1, amount do
repeat
task.wait()
print("repeating", flavour)
until self.SpawnClear
self:Create(flavour)
print("flavour", flavour, "created")
task.wait(1/amount)
end
table.insert(finishedFlavours, flavour)
end)()
end
while #finishedFlavours ~= DictionaryLength(flavoursToDrop) do
task.wait()
end