How can I pause all my tweens?

Heyo trying to make a pause system for my game that actually pauses everything and before anyone asks it’s a single player server so yeah so it’s fine anyways I’m struggling with figuring out how I could pause all my tweens or any current tweens? I have a healthbar that works like this

And need to pause the tween that moves the red part anyone know how I could do that? My idea was to use a dictionary that holds all the active tweens which I could then pause, but not sure how I’d set that up. Also this is what I’m doing this to tween it

Frame:TweenSize(UDim2.fromScale(Health,Frame.Size.Y.Scale), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, Time)

Frame:TweenSize only plays the Tween so it cannot be controlled, use this:

local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(Time, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local Tween = TweenService:Create(Frame, Info, {Size = UDim2.fromScale(Health,Frame.Size.Y.Scale)})
1 Like

Make sure to :Play() the tween and then pause it when you need to.

1 Like

I would put all the tweens in an array (or a module script) and loop through it to :Stop them.