local DSS = game:GetService("DataStoreService") local PlayerCash = DSS:GetDataStore("Tix") game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) local Folder = Instance.new("Folder") Folder.Name = "Data" Folder.Parent = Player local Cash = Instance.new("IntValue") Cash.Name = "Tix" Cash.Parent = Player.Data Cash.Value = PlayerCash:GetAsync(Player.userId) or 0 game.Players.PlayerRemoving:connect(function(Player) PlayerCash:SetAsync(Player.userId, Cash.Value) end) end) end)
When I test out to see if it works, it doesn't save at all. If I change the intvalue, it changes. But when I stop studio to see if it worked and play it again. It sets back to zero.
Do you have API services enabled?
If you already do then I don't know what's going on. However, I do have a script made by XxxLloyd061302xxX, my favorite youtuber.
local ds = game:GetService("DataStoreService"):GetDataStore("--Cash01") game.Players.PlayerAdded:Connect(function(player) local key = "cash-"..player.userId local folder = Instance.new("Folder",player) folder.Name = "leaderstats" -- Must be lowercase local currency = Instance.new("IntValue",folder) currency.Name = "Money" currency.Value = 0 local save = ds:GetAsync(key) if save then currency.Value = save end currency.Changed:Connect(function() ds:SetAsync(key,currency.Value) end) end)
You can chose to use it or not. I just thought I might put this up here for others with the same question. Subscribe to the script maker here
Best wishes, Jail