How come the new multiplier variable will save but the new cost variable won't?(Rebirth system)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want the new cost variable to be able to save so that when the player leaves and rejoins their rebirth cost will still be the same.
  2. What is the issue? Include screenshots / videos if possible!
    The issue is, is that the new cost variable is unable to save but the new multiplier variable is able to.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    No, but I did try getting help from other communities.
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local MaxLevel = 25
local OpenrebirthFrame = script.Parent:WaitForChild("RebirthOpen") 
local RebirthFrame = script.Parent:WaitForChild("RebirthFrame") 
local RebirthButton = RebirthFrame:WaitForChild("Rebirthing") 
local leaderstats = player:WaitForChild("leaderstats") 
local Rebirths = leaderstats:WaitForChild("Rebirths")  

    local Wins = leaderstats:WaitForChild("Wins")

    print("Wins.Value:", Wins.Value)
    print("MaxLevel:", MaxLevel)
    if Wins.Value >= MaxLevel then 
        local didPlayerRebirth = RebirthFunction:InvokeServer()  
        didPlayerRebirth = true  
        local newMultiplier = Rebirths.Value + 2 

        RebirthFrame.Multiplier.Text = "Your new multiplier will be "..newMultiplier .. "x"
        MaxLevel = MaxLevel * 2

        local newCost = MaxLevel + Wins.Value -- Assign value to newCost

        RebirthFrame.Cost.Text = "Cost: " .. newCost .. "Wins"
        RebirthFrame.Cost.Text = "Not enough wins" 
        local newCost = MaxLevel + Wins.Value
        RebirthFrame.Cost.Text = "Cost: " .. newCost .. " Wins"

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

You’re gonna have to use DataStores for that

Oh no, they are being saved, but just in another script

Also, I was wrong, neither are being saved, new multiplier was just being updated so I think I know what to do and I will have to perform some calculations for the rebirth cost instead of trying to save it.