How to make stamina work

https://gyazo.com/976abab053ea071a8a6f694ded2d9216

I’m scripting a stamina bar. I want the stamina not to go out the frame.

local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local char = player.Character
local hum = char:WaitForChild("Humanoid")

local Stam = game.Players.LocalPlayer:WaitForChild("Stamina")
local MaxStam = game.Players.LocalPlayer:WaitForChild("MaxStamina")

local Frame = script.Parent
local IL = script.Parent.ImageLabel



Stam.Changed:Connect(function()
	print("Changed")
	IL:TweenSize(UDim2.new(Stam.Value/MaxStam.Value,0,1,0), "Out", "Quart", 1)

end)

I believe you would want to use ClipsDescendants

1 Like