I got an health bar and a special move energy bar. Two "graphics.drawBox", both work if taken alone, but once they are in sequence only the last one executes.
How do I get them work in parallel?
First "graphics.drawBox" script:
local health
graphics.addDrawFunc("draw()", 0)
function drawHealthBar()
health = (Values["MC_health"].Int / 100) * 600
-- + --
function draw() graphics.drawBox(293, 85, health, 40, 0x00ffff, 1) end
end
registerEventHandler("mainLoop", "drawHealthBar")
Second "graphics.drawBox" script:
local fireball_level
graphics.addDrawFunc("draw()", 0)
function drawFireballBar()
fireball_level = (Values["MC_fireball_level"].Int / 100) * 100
-- + --
function draw() graphics.drawBox(1780, 669, fireball_level, 40, 0x00ffff, 1) end
end
registerEventHandler("mainLoop", "drawFireballBar")