Jump to content

Problems Syncing a table


Controlled

Recommended Posts

So I put a table in a shared file for both server and client to add to. When I add something to the table in server side,

table[row][2] = value

It doesn't return in the client side. I tried syncing it with a function in the shared file like this:

Shared:

  
function syncTables(row, value, info) 
  if row and value and info then 
    table[row][value] = info 
  end 
end 
  

Server:

  
syncTables(1, 2, "Hi") 
  

Client:

  
for key, value in pairs(table) do 
outputDebugString(value[2]) 
end 
  

Client will return nil whereas the server will return "Hi" properly...

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