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

How to add information to game that can be used to all players in roblox studio?

I have a folder, so I want that player writing information in it and it add to folder that can be use to all servers

1 answer

You can use shared or _G. They are tables that can be used in any script in the server, even in local scripts.

--Script 1 (Server Script)

shared._helloMessage = "hi"
print(shared._helloMessage) --> hi

--Script 2 (Server Script)

print(shared._helloMessage) --> hi

--Script 3 (Client Script)

print(shared._helloMessage) --> hi
print(_G._helloMessage) --this will print nil because it wasn't identified
print(shared.Money) --this will also print nil because it wasn't identified

but this can only be accessed inside the server and not the other servers

3 comments

0

i need to all servers

0

i mean that i need save information to game folder

0

The only way is to use OrderedDataStores. Most global leaderboards use OrderedDataStore to get all DataStore in all servers.

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