This was posted before, but it assigns a random ID on every run. I tried running the second script Grimwold posted that I've edited to suit my needs, but that just crashed the editor.
Code: Select all
function killCube()
for i in entitiesAt(1,6,14) do
if i.name == "cube"
then
i:destroy()
end
end
end
This is the error it gives when it crashes.
stack traceback:
[string "Cube.lua"]: in function 'crushEntities'
[string "Cube.lua"]: in function 'update'
[string "Monster.lua"]: in function 'update'
[string "Map.lua"]: in function 'updateEntities'
[string "Dungeon.lua"]: in function 'updateLevels'
[string "GameMode.lua"]: in function 'update'
[string "DungeonEditor.lua"]: in main chunk
[C]: in function 'xpcall'
[string "DungeonEditor.lua"]: in function 'preview'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk
stack traceback:
[C]: in function 'error'
[string "DungeonEditor.lua"]: in function 'handleError'
[string "DungeonEditor.lua"]: in function 'preview'
[string "DungeonEditor.lua"]: in function 'update'