Unable to cancel tween

local function TimerStart(progressBar) 
    local number = (boxNeeded+crateNeeded+barrelNeeded+metalNeeded+woodNeeded) * 20


    local Tween = TweenService:Create(ProgressBar, TweenInfo.new(number/2), {BackgroundColor3 = Color3.new(0.666667, 0, 0)}) 
    ProgressBar.Size = UDim2.new(1, 0,0.9, 0)
    ProgressBar.BackgroundColor3 = Color3.new(0, 0.8, 0)
    for i = number, 0, -1 do 
        print(i)
        progressBar:TweenSize(UDim2.new(0, 0, 0.9, 0), nil, nil, number) 
        wait(1) 
        done = false
        Tween:Play() 
        
        if orderDone then
            Tween:Cancel()
            progressBar.Size = UDim2.new(1, 0,0.9, 0)
            progressBar.BackgroundColor3 = Color3.new(0, 0.8, 0)
            --print("changed")
        --    script.Parent.BillboardGui.Enabled = false
            if i >= number/2 and game.ReplicatedStorage.Rating ~= 5 then
                game.ReplicatedStorage.Rating.Value += 0.1
            
            end
            i = number
            
            break
        end
        if i == 0 or ProgressBar.Size == UDim2.new(0, 0, 0.9, 0) and not orderDone then 
            game.ReplicatedStorage.Rating.Value = game.ReplicatedStorage.Rating.Value - 0.1
            Tween:Cancel()
    
            dummy.Humanoid:MoveTo(game.Workspace.NPCSPAWN.Position)
            billboard.Adornee = script.Parent
            orderDone = true
        --    script.Parent.BillboardGui.Enabled = false
            dummy.Humanoid.MoveToFinished:Wait()
            destroyObjects("Box", boxNeeded)
            destroyObjects("Crate", crateNeeded)
            destroyObjects("Barrel", barrelNeeded)
            destroyObjects("Metal", metalNeeded)
            destroyObjects("Wood", woodNeeded)
            boxNeeded = 0
            crateNeeded = 0
            barrelNeeded = 0
            metalNeeded = 0
            woodNeeded = 0

            progressBar.Size = UDim2.new(1, 0,0.9, 0)
            progressBar.BackgroundColor3 = Color3.new(0, 0.8, 0)
            dummy:Destroy()
            dummy = nil
            
            

            
            i = number

            break 
        end
    end
end

i think that part of the script is the problem, bu problem is, when the order done == true, the Progress changes size but got changes instantly by the tween

the other parts seems to work, but just not the change size part

i think this might be a problem of the tween not stopping after running a bit of testing

maybe try: TweenService:Cancel(Tween) i havent tested it out yet but it might work

i don’t think thats how it works, didn’t work btw