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

This data store isn't working and i don't know why. Any ideas? (NO ERRORS)

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

It get stuck at ds:SetAsync()

0
plyr.UserId instead of plyr.Name?? greatneil80 2647 — 6y
0
Nope. You can use plyr.Name for data saving. Void_Frost 571 — 6y
0
As it had been said, using names for Data Saving is a bad practice as names can be changed. Robertandy11 103 — 6y
0
I dont care. Still doesn't work. Void_Frost 571 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I kinda see a problem, IF you have Filtering Enabled on. A server script cannot access a player's PlayerGui (if Filtering Enabled is on). This is all I can help.

0
Filtering enabled is off. Void_Frost 571 — 6y
0
Then I do not know, I use a different technique for saving datas (and it's very basic lol). CounterBoy123 53 — 6y
Ad

Answer this question