I made all kinds of adjustments to this bit of code and nothing so far has worked. I want the textbox (DepletingMeter) to update and become more transparent as the "stam" value decreases and less transparent as it increases. The adjustments I've tried to make either cause the script to hang or just not function the way I'd like it to.
Here's my code.
local stam = game.Players.LocalPlayer.Character.StaminaValue.Value
wait(1)
while true do
script.Parent.StaminaDisplay.Text = "Super Sprint: ".. stam
wait(0.01)
if stam < 100 then
script.Parent.DepletingMeter.BackgroundTransparency = 1-(stam/100)
end
end
Thank you in advance.

3 comments
Is this in a local script? Any errors and where does the script hang? You should have a break somewhere to make sure it stops the loop. Preferably if stamina gets to 0.
stam is not a reference to the actual property of the StaminaValue. You'll need to write stam.Value for each time you want to get the value.
Or he could simply put the "stam" variable inside the loop :l