Called when the player closes the GUI they have open.
This can only be raised when the GUI's player controller is still valid. If a GUI is thus closed due to the player disconnecting, dying, or becoming a spectator in other ways, it won't cause this event to be raised.
It's not advised to open any other GUI during this event because if this is run as a request to open a different GUI the game will force close the new opened GUI without notice to ensure the original requested GUI is opened.
player_index: uint32 — The player closing the GUI.gui_type: defines.gui_type — The type of GUI that was closed.tile_position?: TilePosition — The position of the tile whose GUI was closed.equipment?: LuaEquipment — The equipment whose GUI was closed.entity?: LuaEntity — The entity or entity grid whose GUI was closed.item?: LuaItemStack — The item whose GUI was closed.other_player?: LuaPlayer — The other player whose GUI was closed.element?: LuaGuiElement — The custom GUI element that was closed.surface_index?: uint32 — The surface index of the global electric network whose GUI was closed.inventory?: LuaInventory — The script inventory whose GUI was closed.name: defines.events — Identifier of the eventtick: uint32 — Tick the event was generated.