Spajk Posted October 24, 2013 Share 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? Link to comment
BieHDC Posted October 24, 2013 Share Posted October 24, 2013 dont use source simple ignore it Link to comment
Spajk Posted October 24, 2013 Author Share Posted October 24, 2013 From what I know, it cant be ignored. Link to comment
J.S. Posted October 24, 2013 Share 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")) Link to comment
BieHDC Posted October 25, 2013 Share 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? Link to comment
Spajk Posted October 25, 2013 Author Share 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? Link to comment
arezu Posted October 25, 2013 Share Posted October 25, 2013 Pass root or resourceRoot, then you dont have to create and destroy a dummy element. 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