Jump to content

Sending details


Anubhav

Recommended Posts

Posted

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. :(

Posted

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.

Posted

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 ._.

Posted

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).

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...