hello all. I want to use a table to store information like the progress a player has made in the game and other info, and I plan on using a table to store all the information. my question is where I should store the table. currently I have it in a module script in starterplayer script, and using require to cal the data. But im wondering if its even possible to change values in the module script, and whether it would be easier to place the table into a script like a local script in starterplayer.
ModuleScripts return the same instance if required in the same environment and tables are mutable values. Any subsequent requires on that data storage module will return the same table and you can edit it as you like with the changes showing up in other LocalScripts as well.
A LocalScript would not make this easier because then you’d have to expose certain methods via BindableEvents or otherwise so that other code can read or write data.
2 Likes
put the table in your main script and use bindablefunctions to change the data from other scripts