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