Hello devs! Why use "shared" and how to set it?
-- Isn't correct
local table1 = {}
shared = table1
Hello devs! Why use "shared" and how to set it?
-- Isn't correct
local table1 = {}
shared = table1
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
You don't set shared itself, you add to it just like you would with _G. It's just another table shared across all scripts. If you structure your game's code well, you shouldn't need to use either.
..i used shared when i need a game state variable though T_T
Then you didn't structure your game code well @FIfkee. You should instead have a module with the variables inside. With that, scripts can change it and other scripts will recieve the game.