_Aion_
Nothing Else
Hello. I'm having this error on otclient console
And this is code that give error
if i remove all code, errors stop, but dont show summon health
Lua:
stack traceback:
[builtin#146]: at 0x011ba470
[C]: in function 'setBackgroundColor'
/modules/poke_bar/pokebar.lua:118: in function 'receive'
/modules/poke_bar/pokebar.lua:46: in function </modules/poke_bar/pokebar.lua:25>
ERROR: protected lua call failed: C++ call failed: LUA ERROR: attempt to cast a 'string' lua value to 'class Color'
stack traceback:
[builtin#146]: at 0x011ba470
[C]: in function 'setBackgroundColor'
/modules/poke_bar/pokebar.lua:118: in function 'receive'
/modules/poke_bar/pokebar.lua:46: in function </modules/poke_bar/pokebar.lua:25>
And this is code that give error
Lua:
pokeBarWindow:getChildById('HP'..i):setBackgroundColor("#ff0000")
if tonumber(hp) == 0 then
pokeBarWindow:getChildById('HP'..i):setText("Desmaiado")
pokeBarWindow:getChildById('HP'..i):setPercent(100);
pokeBarWindow:getChildById('HP'..i):setBackgroundColor("#202020")
pokeBarWindow:getChildById('L'..i):setColor("gray")
pokeBarWindow:getChildById('bar'..i):setImageSource("bar2.png")
else
color = color..string.format("%.2x",255-math.ceil(hp)*2.5)..string.format("%.2x",math.ceil(hp)*2.5)..string.format("%.2x",0)
pokeBarWindow:getChildById('HP'..i):setBackgroundColor(color)
if tonumber(hp) == -1 then
pokeBarWindow:getChildById('HP'..i):setPercent(100);
pokeBarWindow:getChildById('HP'..i):setText(string.format( "%3d %%", 100 ) ) ;
else
pokeBarWindow:getChildById('HP'..i):setPercent(hp);
pokeBarWindow:getChildById('HP'..i):setText(hp.."%");
end
end
if i remove all code, errors stop, but dont show summon health