pcall(function()
	StatsDatastore:UpdateAsync(plr.UserId, function() 
		if playerstats[1] < money then
			return playerstats
		end
	end) 
end)

StatsDatastore is my datastore, playerstats[1] is the money value players have that was gotten from getasync and money is what the new value would be.

I'm wondering if this is the right way on using updatasync, the player's money should never go down and only goes up in my game, so by doing this would I be preventing data loss as it would never save data if it's lower than what the value already is e.g trying to save a value of 0 money over something like 1000? Thanks