Local Variables

Because you didn’t increase it?
Your stamina obviously returns 0.

There’s a difference between:
[lua]local variable = 0[/lua]
and
[lua]ply.variable = 0[/lua]