How do I save values that in a folder when a server opens and closes using a datastore?
I have a ban folder which check if a user's id is in a folder it kicks them. I want to be able to add ID's while in-game (which I have scripted), but I need the values to save inside the folder when the server shuts down, and to insert them when the server starts using a datastore. I'm not sure where to start and what to do.
Hierarchy:
My current code that I have:
1 | local rs = game:GetService( "ReplicatedStorage" ) |
2 | local dss = game:GetService( "DataStoreService" ) |
3 | local bds = dss:GetDataStore( "BanList" ) |