Kuxynator's Lua-Console


Run lua commands without losing achievements. [NEW]: 🌙Dark mode, 🅰️Monospace font, 📑multi tab, 🧑‍🔧per user settings [NEW]: 🗔 Error dialog instead of console

Utilities
4 months ago
2.0
198
Cheats

g Command returns error when it shouldn't

10 days ago
(updated 10 days ago)

/c for _, surface in pairs(game.surfaces) do for _, e in pairs(surface.find_entities_filtered{ force = "enemy", type = "unit" }) do if e.name:find("biter") then e.destroy() end end end
This command works fine when run in the in-game console, but returns the following error when run in your console:
1 : local player = game.players[1] 2>: /c for _, surface in pairs(game.surfaces) do for _, e in pairs(surface.find_entities_filtered{ force = "enemy", type = "unit" }) do if e.name:find("biter") then e.destroy() end end end Error in line 2: attempt to perform arithmetic on field '?' (a userdata value) stack traceback: Error in line:2: in main chunk

New response