Spajk Posted October 24, 2013 Posted October 24, 2013 Quite simple question, as source is an required argument, what should I do when a certain event is not tied/related to any element?
J.S. Posted October 24, 2013 Posted October 24, 2013 If the event isn't supposed to trigger for anyone in particular (such as an automated server maintenance event) you could just use a dummy element for it. triggerEvent("eventHere", createElement("dummy"))
BieHDC Posted October 25, 2013 Posted October 25, 2013 I think he means the built in events i give you an example addEventHandler("onPlayerConnect",root,function() createExplosion (0, 0,4 ,10) end ) now the source isnt used, i just create an explosion when a player connects its maybe not the best example, but is this something you meant?
Spajk Posted October 25, 2013 Author Posted October 25, 2013 @BieHDC I didnt mean on the built in events @J.S. Just what I was asking, thanks. EDIT: Would it be ok to destroy the dummy element after the event has been triggered?
arezu Posted October 25, 2013 Posted October 25, 2013 Pass root or resourceRoot, then you dont have to create and destroy a dummy element.
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