How to make a stamina system, Difficulty: (🟩)

First, place down a property called “Stamina.” Make it’s property type number and the scope should be player. The starting value should also be 0. Now place down an inventory item manager that tracks the property “Stamina.” Make the item the item inventory manager manages to energy, (or whatever your player uses to move.)
Next make sure that there isn’t an item alert.
Now place down a movement meter with tracked item to energy, (or whatever your player uses to move.) Now make item drain per tick (whatever), and drain interval, (whatever.)

Now place down a lifecycle with no settings changed, and a repeater. Make the task interval in the repeater the same as your movement meters drain interval. Now make it so that the repeater stops when receiving on a channel. Now wire the lifecycle to the repeater so that event occurs, start repeater. Now place down a trigger with the following block code:
Screenshot 2023-08-14 6.50.32 PM
This block code shows when a player reaches a certain energy amount, they will be slowed down. Change this depending on when you want or how often you want your players to slow down. Now wire the repeater to the trigger so that task occurs, trigger. Now place down some speed modifiers based on how often your player will be slowed down.
Now go into your speed modifers and make it so that they will each set your players to the configured speed when receiving on their respective channels.
And there you go! a working stamina system, but there is a limit to speed modifiers, and i don’t think this would work that well if your player has an absurd amount of energy.
There is probably a more efficient way to do this, so this is most likely not the best way.

3 Likes

Nice guide. Although, to some limit, couldn’t you just broadcast a rounded version of the property?

1 Like

wdym? i’m confused

I’ll sent screenshot.

1 Like

ok



Wouldn’t this work? The speed modifiers take in the transmissions, and it works easy, right?

1 Like

Uhm, idk, i think? i’m not huge on blocks.

Great guide, and great idea!

1 Like

Is the great idea my suggestion?

1 Like

Both, but yeah.

2 Likes

I am going to test out my strategy now.

It works! It took me forever because I forgot to wire the lifecycle to the repeater, but one I remembered that it worked! I became faster (I set it so that would happen) when my energy fell below 300! It works!

1 Like

nice!

bump!!!

1 Like

superbump