Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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()

4 comments

0

plyr.UserId instead of plyr.Name??

0

Nope. You can use plyr.Name for data saving.

0

As it had been said, using names for Data Saving is a bad practice as names can be changed.

0

I dont care. Still doesn't work.

1 answer

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.

2 comments

0

Filtering enabled is off.

0

Then I do not know, I use a different technique for saving datas (and it's very basic lol).

This discussion is preserved as it was. New answers, comments, and votes are closed.