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

Data Store not working, anybody know why? (Stuck on SetAsync)

Asked by 6 years ago
Edited 6 years ago
ds=game:GetService("DataStoreService"):GetDataStore("data")
game.Players.PlayerRemoving:connect(function(plyr)
data={["Cash"]=plyr.PlayerGui.GameGui.Cash.Value,["Rubies"]=plyr.PlayerGui.GameGui.Rubies.Value}
print(plyr.Name)
print("Cash: "..data["Cash"])
ds:SetAsync(plyr.Name,data)
print("Set Value!")
end)



I debugged it using print and found it gets stuck at ds:SetAsync()

(Note to mods, or people who can moderate. Yes, this is a duplicate of This question

But, To quote the note i got for posting a duplicate before, "This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here."

The past answers do not fully address my question. Thank you for understanding why this should NOT be marked as duplicate

0
I'm having the same issue, figured I was just doing something wrong somewhere. SchonATL 15 — 6y
0
What part of this doesn't work? T1mes 230 — 6y
0
@Times i said, i get stuck on ds:SetAsync(), that wont run, nothing past it runs Void_Frost 571 — 6y
0
Quoting from the wiki: "Using GetAsync to retrieve a value and then setting the key with SetAsync is dangerous because GetAsync sometimes returns cached data." RayCurse 1518 — 6y
0
As far as I can see, you don't need to access the existing data and check whether or not it's nil . As long as you aren't doing anything with the existing data, it doesn't matter whether it's nil or not. RayCurse 1518 — 6y

Answer this question