I am Testing coroutine But Why It Prints Dead?

The Script:

local function deletePart(hit)
	hit.Parent.Humanoid.Health:TakeDamage(1000)
end

local TestThread = coroutine.create(deletePart)
workspace.Part.Touched:Connect(function()
	coroutine.resume(TestThread)
	print(coroutine.status(TestThread))
end)
1 Like

I’m no professional in coroutines, but I think it’s because the coroutine finishes before the print. Try making a local for the resume part and make it two variables.