Why isn't my coroutine working?

I want to make a coroutine

It does not work.

Nothing.

I am trying to make a coroutine but when it does it will not work whatsoever. I am making a coroutine.wrap function to create my modulescript but it stops working unless

coroutine.wrap(function()
			while wait() do
				if MinBreakTime >= MaxBreakTime then
					MinBreakTime = 0
					break
				end
				
				MinBreakTime = MinBreakTime + 1
				Mesh.MeshId = "rbxassetid://"..MeshIdA
				wait(Time)
				Mesh.MeshId = "rbxassetid://"..MeshIdB
				wait(Time)
			end
		end)

Coroutine wrap creates a function. You have to call it:

coroutine.wrap(function()
  -- ...
end)() -- extra set of parentheses
1 Like

I never knew this lol this is my first time learning coroutines! Thanks