First what you’ll need
1x Movement meter
1x Repeater (Fight me @Shdyw)
1x Item Granter
2x Game overlay
1x Wire repeater
1x Inventory Item Manager
1x speed modifier
What You might think is the solution
Just set the Movement meter to a slower speed when it has none of the required resources.
This MAY work, but if you want it togglable then this won’t work. Plus you can’t refill this way, so it’s like a one-time Dash system (I’ll link it here when I find it)
What the Solution is to an overengieerer(?)
The first thing you should place is the popup and set it to be a button. This will be how you trigger the sprint. Now make a movement meter set to remove a resource (a different one than the one used for basic movement, so we’ll use Energy Packs). Then wire it up to a repeater so when the Energy packs are out, the repeater starts. But don’t directly link the movement meter to the repeater, instead link it to a Wire repeater THAN link it to the repeater so there’s a delay in stamina regen.
Then you will need to set a maximum amount of Stamina. For this, we’ll use an Item inventory manager. Set it to make a maximum limit on the item you use for stamina (Energy packs). Then we need to head back to the movement meter. Add a speed modifier between the overlay and the movement meter. Set it to deactivate the speed modifier when the player has no more resources, and link the overlay to the speed modifier so that when pressed, activates both the movement meter and speed modifier.
Then You should be done!