Anubhav Posted July 20, 2014 Share Posted July 20, 2014 After a long time, I asked a question. Ok so, If I have create window in window.lua then can I send it to another client file example: send the window to functions.lua? I have seen some scripts, but compiled ones. Link to comment
TAPL Posted July 20, 2014 Share Posted July 20, 2014 If it in same resource and as long you didn't make it local you can use it or you'll need to use triggerEvent. Link to comment
Anubhav Posted July 20, 2014 Author Share Posted July 20, 2014 It is in same resource.. So I should use triggerEvent for other resources and for in this resource use those only? Give me example please ._. Link to comment
12p Posted July 20, 2014 Share Posted July 20, 2014 Not really necessary to do that. In the same resource, every variable that is declared as global (not adding the "local" prefix makes a variable automatically global) is accesible by every other file of the same resource, as long as said files are all client-side or server-side; you can't switch from one to another. In that case, you'll have to use the event system. However, be careful when doing this, because sometimes you might want to trigger a function depending on a variable that wasn't declared yet, and that will cause an error (e.g. trying to access your window before that window gets created in first place). 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