I recently release or transfer my game to data store 2 but sometimes it decrease there data.
Script :
local DS2 = require(game.ServerScriptService.Settings:WaitForChild("MainModule"))
DS2.Combine("MasterKey", "leaderstatss")
game.Players.PlayerAdded:Connect(function(plr)
local dataCoins = DS2("leaderstatss", plr)
local folder = Instance.new("Folder", plr)
folder.Name = "leaderstats"
local Coins = Instance.new("IntValue", folder)
Coins.Name = "Coins"
if dataCoins:Get() ~= nil then
Coins.Value = dataCoins:Get()
else
Coins.Value = 0
end
Coins.Changed:Connect(function()
dataCoins:Set(Coins.Value)
end)
end)
Can you help me to proper setup this Data Store 2.