FUNExtreme Posted July 7, 2010 Posted July 7, 2010 Hello, I currently understand almost everything of the lua coding structure although there is one thing that keeps annoying me. Tables, I'm able to use them when it comes to the script where they are created but from the moment I try to use them globaly it gives errors. So my question: Is it possible to use tables as a global variable? Note: I didn't make them local xp
Gamesnert Posted July 7, 2010 Posted July 7, 2010 I don't understand the problem. Can you please explain what errors you're getting? And can you please show us some code so we can see what you're trying to do?
FUNExtreme Posted July 7, 2010 Author Posted July 7, 2010 I'm trying to use a table wich was created in (for example) table.lua inside the script table1.lua You understand what I mean?
MaddDogg Posted July 7, 2010 Posted July 7, 2010 As long as their both on the same side (server or client) and the table is not local, it'll work. But still: Give us your code, or nobody will be able to help you.
FUNExtreme Posted July 7, 2010 Author Posted July 7, 2010 So if I understand correctly, the only way it would give trouble is when the table.lua (where the table is) is server-side and the other script where I try to use it is client-side? If that is correct then I found my problem
Lordy Posted July 7, 2010 Posted July 7, 2010 tables work exactly like any other variable. Let's say you have a server side variable serverVar = "niceHair". It can be called from server side scripts of that resource. Same case if you had a server side table serverTable = {}. You can operate with it only server side.
FUNExtreme Posted July 7, 2010 Author Posted July 7, 2010 Ok thanks, Because I didn't know that I just wasted a couple of houres debugging and trying other things
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