local DataStore2 = require(1936396537)
DataStore2.Combine("MasterKey", "Yuan", "Kills")
game.Players.PlayerAdded:Connect(function(plr)
local yuanData = DataStore2("Yuan", plr)
local killsData = DataStore2("Kills", plr)
local leaderstats = Instance.new("IntValue", plr)
leaderstats.Name = "Stats"
local yuan = Instance.new("IntValue", leaderstats)
yuan.Name = "Yuan"
local kills = Instance.new("IntValue", leaderstats)
kills.Name = "Kills"
if yuanData:Get() ~= nil then
yuan.Value = yuanData:Get()
else
yuan.Value = 0
end
if killsData:Get() ~= nil then
kills.Value = killsData:Get()
else
kills.Value = 100
end
yuan.Changed:connect(function()
yuanData:Set(yuan.Value)
end)
kills.Changed:connect(function()
killsData:Set(kills.Value)
end)
end)
my datastore2 doesn't work if either of the values go down from what it is, only saves if it goes up??
