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

Is there a way to create a global table?

Asked by 6 years ago
Edited 6 years ago

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)

1
Use module scripts and/or bindables. User#24403 69 — 6y
1
use modules supercoolboy8804 114 — 6y
0
ok but are there any tutorials or something like that? MageMasterHD 261 — 6y
0
look up questions about it in the search bar User#23365 30 — 6y
View all comments (2 more)
1
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.) fanofpixels 718 — 6y
0
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. Fifkee 2017 — 6y

1 answer

Log in to vote
0
Answered by 4 years ago

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 :)

Ad

Answer this question