Hi! I currently have a basic stamina system and a test weapon. This weapon consumes 18% of my stamina.
The issue is that my stamina is coded to refill when it’s not at full (something I looked over) and I realize now I can’t think of any way to detect when it’s “consumed.”
My Code (focusing the regen part)
while true do
game:GetService('RunService').RenderStepped:Wait()
if not sprinting then
if not regenCooldown then
regenCooldown = true
wait(1.25)
else
stamina.Value = math.clamp(stamina.Value + 1, 0, 100)
wait(0.028)
end
end
end```
Thanks for any help!