Fabioxps Posted January 31, 2015 Share Posted January 31, 2015 the event is not being removed lol = {} function lol:lal() outputChatBox("remove event from table ") end addEventHandler("onClientRender", root, function() lol:lal() end) setTimer(function() removeEventHandler("onClientRender", root, function() lol:lal() end) end,1000,1) Link to comment
manawydan Posted January 31, 2015 Share Posted January 31, 2015 try this, no tested: lol = {} function lol:lal() outputChatBox("remove event from table ") end addEventHandler("onClientRender", root, lol:lal) setTimer(function() removeEventHandler("onClientRender", root, lol:lal) end,1000,1) Link to comment
Fabioxps Posted January 31, 2015 Author Share Posted January 31, 2015 try this, no tested: lol = {} function lol:lal() outputChatBox("remove event from table ") end addEventHandler("onClientRender", root, lol:lal) setTimer(function() removeEventHandler("onClientRender", root, lol:lal) end,1000,1) it does not work. Link to comment
Jaysds1 Posted February 1, 2015 Share Posted February 1, 2015 (edited) try this: local lol = { lal = function() outputChatBox("remove event from table ") end } addEventHandler("onClientRender", root,lol.lal) setTimer( function() removeEventHandler("onClientRender", root,lol.lal) end ,1000,1) Edited February 1, 2015 by Guest Link to comment
pa3ck Posted February 1, 2015 Share Posted February 1, 2015 lol = {} lol.lal = function () outputChatBox("remove event from table ") end addEventHandler("onClientRender", root, lol.lal) setTimer(function() removeEventHandler("onClientRender", root, lol.lal) end,1000,1) Link to comment
Fabioxps Posted February 2, 2015 Author Share Posted February 2, 2015 it is possible to pass arguments in functions lol.lal(arg) addEventHandler("onClientRender", root, lol.lal(arg)) Link to comment
Jaysds1 Posted February 2, 2015 Share Posted February 2, 2015 Yes, it's possible to pass arguments through functions but you can't pass them through an event handler. Link to comment
Fabioxps Posted February 2, 2015 Author Share Posted February 2, 2015 thank you very much. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now