Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to use 'revive' a dead corountine inside a module script?

Asked by 8 years ago
local printThis = coroutine.wrap(function()
game.Workspace.BasePlate.BrickColor = BrickColor.new(Color3.new(1,0,0))
wait(1)
game.Workspace.BasePlate.BrickColor = BrickColor.new(Color3.new(0,1,0))

end)

return printThis

I had a problem whenever someone triggers a module script and dies, the module script will stop. Please help. I can only run this a single time.

0
wrap that coroutine in another function and call that instead XAXA 1569 — 8y
0
^ It makes it stop on death. Please listen drslicendice 27 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Nevermind.. I fixed it.

Disguise = coroutine.wrap(function()
while true do
local Module = coroutine.wrap(function()
print("Hola")
wait(15)
print("Adios")
end)
Module()
coroutine.yield()
end
end)

return Disguise
Ad

Answer this question