local rs = game:GetService("ReplicatedStorage")
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("AdminDatastore")
game:IsLoaded(function()
DataStore:GetAsync()
end)
game:BindToClose(function()
wait(10)
for i,v in pairs(game.ReplicatedStorage.AdminEvents.Banned:GetChildren()) do
DataStore:SetAsync(v.Name,v.Value)
end
end)
So I'm experimenting with saving string values names and values when the server shuts down. I need it to set them on the game:IsLoaded part, I'm not sure what to add. Could someone help me if theres anything I need to add on the bindtoclose part, and what to add on the isloaded part to get it to work correct?

9 comments
Note: On line 13 you keep replacing the value of the datastore when you go through the loop.
Then how would I fix that? I also need to set the values into the folder as well which is what i'm needing help with
Okay, I'm writing a response.
No, wait I'm wrong. I was interpreting it wrong. Sorry.
Are you still going to answer and help me?
Do you want to make it so if they join and they're on the list they get kicked for the reason of v.Value?
I already have that. I need it so the values save when the game is shutdown and then they're put back in when the game is launched
Okay. I'm writing it.
Okay.