Kuxynator's Lua-Console


Run lua commands without losing achievements. Update for Factorio 2.1

Utilities
12 days ago
2.0 - 2.1
406
Cheats

g Command returns error when it shouldn't

11 months ago
(updated 11 months 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

12 days ago

sorry for the late response

don't type /c
local player = game.players[1] ist not required, but works

best regards
kux

New response