Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local module = {
- connections = {}
- }
- function module:connect(func)
- local id = tostring(func)
- module.connections[id] = func
- local connectionobj = {}
- function connectionobj:Disconnect()
- module.connection[id] = nil
- end
- return connectionobj
- end
- function invoke(...)
- print"Invoke Running"
- for id, func in pairs(module.connections) do
- print(" - Running "..id.."'s function!")
- local function run(...) func(...) end
- coroutine.resume(coroutine.create(run),...)
- end
- print" Invoke Done!"
- end
- return module, invoke
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement