stop running when stamina is 0

Hello,

i want to stop my player running when the stamina is 0, but this script doesn’t work i have no idea why, can u help please ? When u Click in W the player walk, when you cick the same time in W and E the player Run and stamina bar reduce, when the stamina bar is 0 my stoprunning bool will be true, but my player still running whyyyyyyyyyy ?

This’s my script :

please pot the code itself, not an image. And please use code tags.

You are nor showing when the stamina reduction is executed, only that there is some script that sometime may set it. Also, you should show us where you re-set stopRunning (that is usually what gets me :slight_smile: )