Ok, so I got another obstacle just before releasing my map, I got the warning system working as it uses a while lop like this:
function CheckAttacks() --Warns the player when asteroids are attacked
for i = 0,99 do
local warnasteroid = GetAsteroid(i)
local b = warnasteroid.Owner
local c = warnasteroid.ID
if b == 1 then
while warnasteroid:GetNumSeedlings(0) > 0 or warnasteroid:GetNumSeedlings(2) > 0 or warnasteroid:GetNumSeedlings(3) > 0 do
if b > 0 then
b=b-2
end
if g > 0 then
g=g-2
end
if r > 99 then
redcolor = -2
end
if r < 33 then
redcolor = 2
end
r=r+redcolor
SetBackdropColor(r,g,b)
coroutine.yield()
end
while warnasteroid:GetNumSeedlings(0) == 0 and warnasteroid:GetNumSeedlings(2) == 0 and warnasteroid:GetNumSeedlings(3) == 0 do
if b < bb then
b=b+1
end
if g < bg then
g=g+1
end
if r < br then
r=r+1
end
SetBackdropColor(r,g,b)
coroutine.yield()
end
end
end
end
Any help, because all the other functions stopped working after this was made D: