hello guys i have a problem. you must help fix. grrr.
so basically i have a module script and it has a function where it will add something to a table inside the module script. i also have a function that accesses the table the issue is that when the server adds something to this table and accesses the table, it is able to get the whole table.
HOWEVER, when the client tries to access the table full of stuff that the server put in, it returns nil.
server adds item A to table
server tries to access table
server gets returned {A}
client tries to access table
client gets returned {} (empty)
this is bad
P.S. I’m using this for a stats UI on the client to display stats @AC_Starmarine
oh, well the thing is this is mainly for a ui on the client that updates stats 10 times a second, so firing 10 remote events per second might be too much
actually i COULD use unreliable remote events is that a good idea chat?
You could convert your table into a string using HttpService’s EncodeJson and then set that to a string value in workspace. Then on your client, you could constantly read from that string value, and use the DecodeJson function to turn it back into a normal lua table.
Module scripts that are required by the server and client are diffrent.
If the server requires a Module script, said script runs and returns all of it’s code to the script that required it while also creating a cache to store the returned value for optimization. said cache is network exclusive, so the server’s returned script is difrent from the client’s
I would recommend using RemoteEvents along with some form of compression/optimization to lower Network load.
basically i wanted stats (similar to leaderstats) to show up on a client ui without being on the actual leaderboard so i just made a folder called stats under the plr