dugasz1 Posted October 16, 2016 Posted October 16, 2016 Hello! Is it possible to make callbacks through resource without exports ? Like: resource1: function addCallback(theFunc) --Somehow store the func for later end function callCallback() --Call the callback when it's needed end resource2: function callback() --Callback handle something end exports.resource1:addCallback(callback) --Added the callback Any tip or solution?
Mr.Loki Posted October 16, 2016 Posted October 16, 2016 (edited) You can use events triggerEvent Edited October 16, 2016 by loki2143
dugasz1 Posted October 16, 2016 Author Posted October 16, 2016 I know but in my case it wouldn't be a comfortable solution. I would like to do it like i mentioned.
iPrestege Posted October 16, 2016 Posted October 16, 2016 No you can't don't unless use exports or triggers. 1
dugasz1 Posted October 16, 2016 Author Posted October 16, 2016 Thank you. I will use itt for costume GUI system. This way looks better too me but should i use it or triggers? Any performace difference?
iPrestege Posted October 17, 2016 Posted October 17, 2016 No i don't think they are the same i guess but i'm using exports and it's fine with me working perfect .
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