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

How do I save values that in a folder when a server opens and closes using a datastore?

Asked by
H34E7R 19
5 years ago

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:

local rs = game:GetService("ReplicatedStorage")
local dss = game:GetService("DataStoreService")
local bds = dss:GetDataStore("BanList")
0
I recommend using RemoteEvents to communicate with the server instead of using ReplicatedStorage. It's what they're for. You just need to pass the name of that person (Or UserId) through the :FireServer() then make sure that the client who fired it is the admin/you. xPolarium 1388 — 5y
0
I just need to save the values inside a folder using a datastore so that I can reset all the bans and such. H34E7R 19 — 5y
0
nice code greatneil80 2647 — 5y

Answer this question