Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why use "shared" and how to set it?

Asked by 4 years ago
Edited 4 years ago

Hello devs! Why use "shared" and how to set it?

-- Isn't correct

local table1 = {}
shared = table1
0
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. EmilyBendsSpace 1025 — 4y
0
..i used shared when i need a game state variable though T_T Fifkee 2017 — 4y
0
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. hiimgoodpack 2009 — 4y

Answer this question