For some reason when I raise the values it saves, but if I lower them they don't. idk what to do so plz help. Also, it won't save the weapons value for some reason too, and its a string value.
local DataStore2 = require(1936396537)
DataStore2.Combine("MasterKey", "Yuan", "Kills", "Weapon")
game.Players.PlayerAdded:Connect(function(plr)
local yuanData = DataStore2("Yuan", plr)
local killsData = DataStore2("Kills", plr)
local weaponData = DataStore2("Weapon", plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "Stats"
local yuan = Instance.new("IntValue", leaderstats)
yuan.Name = "Yuan"
local kills = Instance.new("IntValue", leaderstats)
kills.Name = "Kills"
local weapon = Instance.new("StringValue", leaderstats)
weapon.Name = "Weapon"
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 = 0
end
if weaponData:Get() ~= nil then
weapon.Value = weaponData:Get()
else
weapon.Value = "None"
end
yuan.Changed:connect(function()
yuanData:Set(yuan.Value)
print("yuan success")
end)
kills.Changed:connect(function()
killsData:Set(kills.Value)
print("kills success")
end)
weapon.Changed:connect(function()
weaponData:Set(weapon.Value)
print("weapon success")
end)
end)
