[1.1.33] LuaPlayer.disable_alert do not disable alerts
Posted: Sun May 09, 2021 11:36 am
In my simple mod I want disable all custom alerts from alert gui, but LuaPlayer.disable_alert does nothing
Here simplified code with problem
Console prints "Custom is disabled" but custom alerts is still here:
Here simplified code with problem
Code: Select all
function OnTick(e)
for _, player in pairs(game.connected_players) do
player.disable_alert(defines.alert_type.custom);
if player.is_alert_enabled(defines.alert_type.custom) then
player.print("Custom is enabled")
else
player.print("Custom is disabled")
end
end
end
script.on_event(defines.events.on_tick, OnTick);