Fabioxps Posted January 31, 2015 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)
manawydan Posted January 31, 2015 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)
Fabioxps Posted January 31, 2015 Author 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.
Jaysds1 Posted February 1, 2015 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
pa3ck Posted February 1, 2015 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)
Fabioxps Posted February 2, 2015 Author Posted February 2, 2015 it is possible to pass arguments in functions lol.lal(arg) addEventHandler("onClientRender", root, lol.lal(arg))
Jaysds1 Posted February 2, 2015 Posted February 2, 2015 Yes, it's possible to pass arguments through functions but you can't pass them through an event handler.
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