I'm making a random number generator using Coroutine's and I'm trying to get it to stop using coroutine.yield(), but it does not stop. I don't use coroutine's often, so any help is really appreciated.

math.randomseed(tick())	-- Doesent work without this

Co = coroutine.create(function ()
	while true do
		_G.Chance = math.random(1,25)		
		print(_G.Chance)
		wait(5)
	end
end)


coroutine.resume(Co)

if
	_G.Chance >= 21 then
	coroutine.yield(Co)
end