so i have tried both DataStore and DataStore2 to save a list of boolvalues for me and its not saving when it changes but in the server log it says that it does, but it doesnt i do have a DataStore that saves another set of boolvalues and it works just fine even being a regular DataStore
here is the script i got to save them
01 | local DS 2 = require( 1936396537 ) |
02 |
03 | game.Players.PlayerAdded:Connect( function (plr) |
04 | local speedData = DS 2 ( 'Speed' , plr) --Get the speed datastore |
05 | local healthData = DS 2 ( 'Health' , plr) --Get the health datastore |
06 | --Speed |
07 | local Speed = Instance.new( "Folder" ) |
08 | Speed.Name = "Speed" |
09 | Speed.Parent = plr |
10 | local Five = Instance.new( "BoolValue" ) |
11 | Five.Name = "Five" |
12 | Five.Parent = Speed |
13 | local Ten = Instance.new( "BoolValue" ) |
14 | Ten.Name = "Ten" |
15 | Ten.Parent = Speed |
when the values change the server does print Saved MaxHealth Data but when a player rejoins the value is back at false
Yo, I think that I might see the solution epescially for your type of tables that are very large and may take a little longer to SetAsync, you should add in a :BindToClose and then add in a wait, so it gives your Datastores to Setasync I used to have the same problem as you, this is what helped me from the past
1 | game:BindToClose( function () |
2 | if runservice:IsStudio() then |
3 | --wait(2) --Turn on/off wether you wanna enable it on studio |
4 | return |
5 | else |
6 | wait( 2 ) |
7 | end |
8 | end ) |
Feel free to paste it on your script(Also it's highly recommended that you dont delete the comments on line 3, because your studio won't respond if you use a wait for bind to close on studio