DarkLink Posted June 4, 2012 Share Posted June 4, 2012 Hi there guys, I guess the origin of my problem on another topic is because I am not using the same table, its not a clone .. I guess. SO here it is : 1) I have table A on SERVER side . 2) I send my table A to client side 3) I have a function on client side that receives the table, and I assign my local variable to the table A that is received, like: local tableOnClient = {} function funcThatReceivesTable(tablereceived) tableOnClient = tablereceived end MY QUESTION: Is this a pointer to the table? and when I remove a element from this table on client, it gets removed also on the table on the server? or when I send a table to server side, its a clone ? Thanks in advance! Link to comment
Anderl Posted June 4, 2012 Share Posted June 4, 2012 "tableOnClient" is a pointer to the table. No, it does not get removed on server. Yes, it's like a clone. Link to comment
DarkLink Posted June 4, 2012 Author Share Posted June 4, 2012 "tableOnClient" is a pointer to the table.No, it does not get removed on server. Yes, it's like a clone. Hmm I though it would not be a clone So.. I need to remove on both tables, when I want to keep the same info , right ? Thanks in advance .. Link to comment
Anderl Posted June 4, 2012 Share Posted June 4, 2012 Yes, but why would you do need same table on both sides? Link to comment
DarkLink Posted June 4, 2012 Author Share Posted June 4, 2012 Yes, but why would you do need same table on both sides? Because this is a table of objects, and I must destroy and create new ones, on server side, to work for all clients . And I also need that table of objects on client side, because there is a function (only client side) that will tell me, if I wanna destroy a object of that table . if yes, i delete from the table on client and then I trigger server event, and destroy that element and delete from table on server side. Do you understand ? is something bad doing this ? if so, please explain me how to do it good , thanks alot in advance. Link to comment
Anderl Posted June 4, 2012 Share Posted June 4, 2012 (edited) You can do it all in server-side and trigger client event to call that function that "asks" if wanna destroy object from tableand triggering the answer to the server to delete / not delete the object. Do you understand? Edited June 4, 2012 by Guest Link to comment
Castillo Posted June 4, 2012 Share Posted June 4, 2012 Maybe you can create a element server side, set to that element the table, and when the element data changes client side, you update the table with it's new value? Link to comment
DarkLink Posted June 4, 2012 Author Share Posted June 4, 2012 Guys nevermind, I already get it working, using another paradigm. I mean I leaved the two tables (server and client side) solution, and implemented setElementData, and I dont need any tables being sent via triggers Thanks alot all of you that helped 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