Probably a noob question but how can I add an event listener only under a certain condition? Like if local x=0 then addEventListener(function)
You’d write something like:
if x == 0 then
object:addEventListener( "eventName", listener )
-- or
Runtime:addEventListener( "eventName", listener )
-- etc.
end
1 Like