local DataStore = game:GetService("DataStoreService"):GetDataStore("mygamedata")
game.Players.PlayerAdded:connect(function(player)
local currency = player:WaitForChild('leaderstats').Money
local key = "player-"..player.userId
currency.Changed:connect(function()
if player.leaderstats.Money.Value == 1 then
else
local savevalues = {currency.Value}
DataStore:SetAsync(key, savevalues)
end
end)
end)
So, what happens is that, regardless of a player having a money value of 1, the data still gets saved. Why?

1 comment
From what I can see the data is not being saved but you also have to account for the fact that there is already data saved. Also you should add some prints in to check what is being ran where.