I have this code in the onTick-event:
Code: Select all
if (glob.blueprints.overseer.count + glob.blueprints.miningsites.count) > 0 then
if ((event.tick % 300) == 0) and (glob.blueprints.overseer.closed == false) then
if UI.miningsiteOverseerFrame ~= nil then
if UI.miningsiteOverseerFrame.isvalid() then UI.miningsiteOverseerFrame.destroy() end
end
UI.miningsiteOverseer_UI_creation()
end
else
if UI.miningsiteOverseerFrame ~= nil then
if UI.miningsiteOverseerFrame.isvalid() then UI.miningsiteOverseerFrame.destroy() end
end
end
and everything works fine. Later on both variables can be increased and decreased, but each are always >= 0. If at least one variable > 0 everything works fine as well.
But if both are 0 again the UI should be destroyed, instead I got this error:
Code: Select all
111: LuaGuiElementAPI call when gui button does not exist
So how can I solve that problem?