Data loss with DataStore?
Right now im using a while true do loop that saves every 5 seconds but im having a lot of data loss
does it have something to do with the load script or with the save script?
here are the scripts im using right now
Load
01 | player = script.Parent.Parent.Parent.Parent |
03 | local Datastore = game:GetService( "DataStoreService" ):GetDataStore( "OBJ" ) |
05 | local key = "player-" ..player.userId |
07 | local savedObj = Datastore:GetAsync(key) |
14 | local objToSave = { Value 1 , Value 2 ,Value 3 } |
15 | Datastore:SetAsync(key, objToSave) |
Save
01 | player = script.Parent.Parent.Parent.Parent |
03 | local Datastore = game:GetService( "DataStoreService" ):GetDataStore( "OBJ" ) |
06 | local key = "player-" ..player.userId |
07 | local objToSave = { Value 1 ,Value 2 ,Value 3 } |
08 | Datastore:SetAsync(key, objToSave) |
value1 value2 and value3 are just examples
anything wrong with my script?