local T=script.Parent.StaminaValue local z=script.Parent.StaminaBarBG local b=z.StaminaBar local W=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local function J()local z=T.Value/100 local J=UDim2.new(z,0,1,0)local K=W:Create(b,TweenInfo.new(.1,Enum.EasingStyle.Linear,Enum.EasingDirection.In),{Size=J})K:Play()end J();(T:GetPropertyChangedSignal("\086\097\108\117\101")):Connect(J)
-- Important script, don't delete.
local StaminaValue = script.Parent.StaminaValue
local StaminaBarBG = script.Parent.StaminaBarBG
local StaminaBar = StaminaBarBG.StaminaBar
local TweenService = game:GetService("TweenService")

local function updateStaminaBar()
	local StaminaPercent = StaminaValue.Value / 100
	local newBarSize = UDim2.new(StaminaPercent, 0, 1, 0)

	local StaminaTween = TweenService:Create(
		StaminaBar,
		TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In),
		{ Size = newBarSize }
	)

	StaminaTween:Play()
end

updateStaminaBar()

StaminaValue:GetPropertyChangedSignal("Value"):Connect(updateStaminaBar)
