If you are hosting your own server or playing on a private test server, you can use the built-in Native Trainer (F3 or F4 by default).
It checks every second and adds 10 stamina points to the player. It effectively prevents stamina from dropping. This script comes from a Cfx.re development discussion where a new coder was trying to learn the mechanics. fivem infinite stamina verified
This method uses a loop that constantly restores the player's stamina. It is easy to implement but is considered "clumsy" coding. Below is an example script using a Lua command: If you are hosting your own server or
: Inside this loop, RestorePlayerStamina(PlayerId(), 1.0) is called. 1.0) is called.