Hi, I’m trying to make it so that a value will decrease 1 unit per second while a while a certain set of parameters are correct using the time.delay().
I assumed that you just put the number of seconds you want to delay by in the brackets but apparently not? I did look on the documentation but there isn’t any clear examples there. I was just wondering how to do this and if the way I’m going about this is even right in the first place? (which it’s probably not)
function update(self, dt)
if fuel < 0 then
thrust = 0
elseif fuel > 0 then
timer.delay(1)
fuel = fuel - 1
end
end
So basically I want it so fuel
decreases by 1 per second while it’s greater than 0.
Thanks for any help.