Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Using shared variables

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

✓ Accepted answer

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

2 comments

0

So what is the difference of _G and shared then?

0

Never mind, problem is solved.

This discussion is preserved as it was. New answers, comments, and votes are closed.