Sprinting script not handling stamina regen properly

When I spam the shift keybind (run keybind) it drains my stamina faster, then when i stop spamming the keybind my stamina regains much faster then normal. Ive tried many fixes but none of them worked, if you need any more information id be happy to provide

code below:

It’s happening because StaminaRegen() keeps getting called every time you release shift.

I tried to fix that by adding a debounce but it didn’t seem to work, any ideas on how to prevent it from being called more then once?

I figured out a way to implement it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.