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

Using shared variables

Asked by 9 years ago

So I need to access a shared table that is defined in a server-side script with a local script. However, it can't find shared.serverList in the local script.

--inside server script
shared.serverList = {}

--inside local script
Workspace.createServer:InvokeServer(#shared.serverList+1, serverName, serverPassword, public)

1 answer

Log in to vote
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

shared is per-machine. It doesn't replicate from a client to a server or vice versa.

So what is the difference of _G and shared then? PiggyJingles 358 — 9y
Never mind, problem is solved. PiggyJingles 358 — 9y

Answer this question