Jump to content

Variables on different scripts.


Recommended Posts

I have:

scriptone.lua - server side

scripttwo.lua - client side

In server side script "scriptone.lua" i created variable

a = 5

How to know what "a" is equal in client side script "scripttwo.lua" ?

I mean, how to move variables through all same resource scripts ?

Link to comment

It's easy to get them in another server-side script. Synching client-side though can pretty much only be done with triggerClientEvent/triggerServerEvent or setElementData. (imagine the bandwidth usage if every single var that has changed was synched :P)

Link to comment

its true, but i think this is not what he meant. it sounds much more like he wanted to know if two separate resources can share cvariables... which would be CHAOS :P

SO: Serverside global variables can be reached within this single resource, no matter if you used two different files in your resource, but wont be existing in other resources.

Link to comment

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