Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

2 comments

0

wrap that coroutine in another function and call that instead

0

^ It makes it stop on death. Please listen

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.