TheCapn Posted February 18, 2014 Share Posted February 18, 2014 Hello, I'm using a table named plrMpState and I would like to use it in two differents resources : wrCommon and wrChat Actually, my table is declared at the very beggining of the file init.lua in the wrCommon resource, and I would like to use it in the mp.lua file in the wrChat resource. Could you explain me how to manage it ? Regards, Link to comment
pa3ck Posted February 18, 2014 Share Posted February 18, 2014 (edited) You can export functions. Just return your table like, pretend the resource is called 'wrCommon': plrMpState = { "something" } function exportTable( value ) if not value then return plrMpState else return plrMpState[ value ] end return false end Put this into your meta.xml: <export function="exportTable" type="client"/> <export function="exportTable" type="server"/> To get your values from the table use this in your scripts: plrMpState = exports.wrCommon:exportTable() Edited March 3, 2014 by Guest 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