player.opened = nil is how to close a gui, but I believe it's not present, or at least, stated well, in the description of opened:
https://lua-api.factorio.com/1.1.102/cl ... tml#opened
"If this attribute is not nil, and a new GUI is written to it, the existing one will be asked to close." - Describing behavior when writing a new gui
"Write supports any of the types" - At best, is writing nil hidden away in the '?' optional of: 'LuaEntity or LuaItemStack or LuaEquipment or LuaEquipmentGrid or LuaPlayer or LuaGuiElement or LuaInventory or LuaTechnology or defines.gui_type?'
A single line of e.g. "Writing nil when opened is non-nil will issue a request to close." is very opaque about how you close a gui.
About writing nil, explicitly, in "opened"
About writing nil, explicitly, in "opened"
I have mods! I guess!
Link
Link
Re: About writing nil, explicitly, in "opened"
Thanks for the note, I added an explicit mention of writing nil to the "If the attribute is non-nil..." sentence for the next doc release.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.