I’ve been reading around for a while but I really require help now. I’m sorry if my set up of this piece of code is wrong (which is likely).
local hunger = 100
if hunger == 100 then
hunger = 80
elseif hunger == 80 then
hunger = 60
Msg( tostring( hunger ) … "
concommand.Add( “uz_WithdrawHunger”, WithdrawHunger )
timer.Create(“timer1”, 2, 5, RunConsoleCommand, “uz_WithdrawHunger”)[/lua]
What I am trying to achieve is that every turn this block of code is executed it will withdraw 20 from the variable hunger.
Although every time it is executed it displays 80 in console.
Thank you for looking and I would love any advice!