Repeat wait(.1) until coroutine.Status("Dead")?

when I try to run this line it throws an error and i don’t know why.

I think you guys can see what I’m trying to do here but I’m new to coroutines as of yesterday

Incase you cant see what I’m trying to do. I’m trying to run this coroutine and make the parent function of the coroutine wait till the coroutine is finished before resuming


		local function task()
					for cycle = 1, 150 do
				PassivePb.Size = UDim2.new(0,cycle,1,0)
				wait(PassiveCooldown/150)
			end		
		end
		
		local coro3 = coroutine.create(task)
		coroutine.resume(coro3)
		repeat wait(.1) until coro3.Status("Dead")   --ERROR LINE
		
OUTPUT:
Players.killaman333.PlayerGui.MasterAbilityGui.MasterAbilityMain:54: attempt to index thread with 'Status'  





You need to call Status function from coroutine library, not on the thread itself.

repeat wait(.1) until coroutine.Status(coro3) == "dead"
1 Like

Same line


OUTPUT:
Players.killaman333.PlayerGui.MasterAbilityGui.MasterAbilityMain:53: attempt to call a nil value  -  Client 

My bad, I accidentally capitalized the “s” in status:

repeat wait(.1) until coroutine.status(coro3) == "dead"
1 Like