FireFlickerFlak Posted October 1, 2014 Share Posted October 1, 2014 (edited) If I have a function on a quest script that registers for an event, for example:Function registerForEvent() registerForSingleUpdate(0.5) EndFunctionAnd I then call this function from another script, for example:Event OnLoad() myQuestScriptName.registerForEvent() EndEventWhich script is being registered for events by this function, the quest script holding the function or the script referencing the quest script? (The reason I ask is I would like to be able to register/unregister my quest script for events via other scripts and I am not sure how to do that.) Thanks Edited October 1, 2014 by FireFlickerFlak Link to comment Share on other sites More sharing options...
Mattiewagg Posted October 1, 2014 Share Posted October 1, 2014 The script holding the function will register for that update, UNLESS the function is Global, in which case the script calling the function will register. It's a useful method which I've used on multiple occasions such as calling functions from the quest script when the player loads the game with an alias, etc. Link to comment Share on other sites More sharing options...
FireFlickerFlak Posted October 1, 2014 Author Share Posted October 1, 2014 Thanks, this will make things work much more smoothly! Link to comment Share on other sites More sharing options...
Recommended Posts