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

Using shared variables

Asked by 10 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
1
Answered by
Merely 2122 Moderation Voter Community Moderator
10 years ago

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

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

Answer this question