I am currently creating an RPG and would like to create a global table where all the guilds are stored because I want to save all guild members and the guild name. Can you do that? Tutorials or the like would be helpful (The table should have the same content on all servers)
COMMUNITY QUESTION
Is there a way to create a global table?
1 answer
Use a global _G (global variable) to do so. You could have like _G.DataForPlayerName = {blah blah blah}. And you can access it from any script. I would recommend (when trying to access it) to use _G:WaitForChild("DataFor" .. Player.Name) to avoid problems. I hope this helps. I know, I responded 1 year later, but still, helpful nevertheless :)
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
Use module scripts and/or bindables.
use modules
ok but are there any tutorials or something like that?
look up questions about it in the search bar
try using datastores, it stores data online and works with tables, though i dont suggest using any value types made by roblox (like Vector3, UDim2, etc.)
Create a datastore. Create a guild system. On guild creation, invoke a RemoteFunction (since you need to wait for success/failure) that is handled by a script that requires the datastore modulescript. Add it to the queue of guilds to be saved during every autosave interval. When the autosave interval completes, everything inside the queue table should be sent into the datastore.