🌕 LUA APIMODMOD:onStateLeaveOn this page MOD:onStateLeavevoid MOD:onStateLeave(state)Global event called by the game before the state is changedParametersTypeNameDescriptionOptionalstringstateThe state opened (ie 'ingame', 'mainmenu', etc)