Sprint system bugged out for mobile

Hello everyone,

So basically, I found a stamina system from a YouTube video which is compatible for pretty much all devices. Works like a charm on PC but is a bit bugged on mobile. For mobile, it’s supposed to only gain speed if you’re holding the sprint button. If you slide down on the sprint button over and over it gives you an insane amount of speed without necessarily holding the button. I was desperately looking for other sprint systems on YouTube but this was the only one with a stamina bar that was compatible for PC and mobile.

So now I decided to head over here and hopefully get some help as this script is pretty much fully functional besides that.

Mobile demonstration:

Triggering the bug by sliding down on the button multiple times (should only have increased speed if holding):

PC demonstration:

Holding shift to sprint giving me speed as intended.

How things are set up inside StarterGui:
image

The code inside the LocalScript:



image

Though I mainly guide myself off of scripting tutorials and have the most basic knowledge of scripting memorized, I’m sure this could be fixed with a few adjustments. If anyone could me guide me through what I would need to do in this situation, I’d appreciate it so much. Once again though how I mentioned earlier, the code is pretty much fully functional besides the bug.