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

Saving String Values in Data Store?

Asked by 5 years ago

Hello,

I was trying to save 2 string values parented inside of the player, But I have some issues:

  • the first String Value is called "desk1" -the second String Value is called "desk2"

so when I get into the game, If desk1.Value and desk2.Value is changed it shows that It got saved but when I rejoin, it still the same.

Script:

01local DS = game:GetService("DataStoreService"):GetDataStore("rubyigergetgseddendikzakinchepes")
02game.Players.PlayerAdded:Connect(function(plr)
03    wait(2)
04    local plrkey = "id_"..plr.userId
05 
06    local savevalue1 = plr.leaderstats.Money
07    local savevalue2 = plr.workspaces0
08    local savevalue3 = plr.desk1
09    local savevalue4 = plr.desk2
10 
11    local GetSaved = DS:GetAsync(plrkey)
12    if GetSaved then
13print(GetSaved[5])
14 
15        savevalue1.Value = GetSaved[1] or 10000
View all 35 lines...

I don't see any errors in the output, But when the values change, They get saved cuz I did does print() inside of the script, So I can see it in the output

Answer this question