Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 25/12/2016
- --Last update: 25/12/2016
- infcoroutine = setmetatable({},{
- __newindex = function(list,index,value)
- if type(value) == "function" then
- rawset(list,index,setmetatable({value},{
- __call = coroutine.wrap(function(t,...)
- t[1] = coroutine.create(value)
- while true do
- if coroutine.status(t[1]) == "dead" then
- t[1] = coroutine.create(value)
- coroutine.resume(t[1],...)
- end
- coroutine.resume(t[1],...)
- coroutine.yield()
- end
- end)
- }))
- else
- rawset(list,index,value)
- end
- end
- })
Advertisement
Add Comment
Please, Sign In to add comment