The stamina system of shown here continuous drains stamina if the sprinting boolvalue is true, through runservice’s heartbeat loop.
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local values = char:WaitForChild("Values")
local sprinting, stamina = values:WaitForChild("Sprinting"), values:WaitForChild("Stamina")
local previous = tick()
game:GetService("RunService").Heartbeat:Connect(function()
if tick() - previous >= 1/100 then
if sprinting.Value and hum.MoveDirection.Magnitude ~= 0 and stamina.Value > 0 then
stamina.Value -= 0.12
print("1")
elseif (not sprinting.Value or hum.MoveDirection.Magnitude == 0) and stamina.Value < 100 then
stamina.Value += 0.2
end
previous = tick()
end
end)
The issue is that the rate drops seldom despite of all other scripts having no more than 1% activity. The drop begins when the sprinting bool is set to true.
https://gyazo.com/29073bb50b8ff7fc72095ac18e8a4b71