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)
		print("yuan success")
	end)
	kills.Changed:connect(function()
		killsData:Set(kills.Value)
		print("kills success")
	end)

I checked over my code countless times and theres nothing wrong and the output says what its supposed to print once the yuan and kill values are changed. But it doesn't print it if the value changes less then what the value previously was?? it doesn't make sense plz help

1 comment

0

3rd party modules are deprecated bro