User Tools

Site Tools


script:world_event:issurvivemode

isSurviveMode


  • Parameters and types: None
  • Return value and type:
    • code: numberSuccess (ErrorCode.OK) ErrorCode
  • The main function of this method: Single-player mode or free mode of adventure mode
  • The specific use cases are as follows:

Judge whether it is single-player survival mode

local result=World:isSurviveMode()
if result==0 then--If it is single-player survival mode
	Chat:sendSystemMsg("Currently single-player survival mode!")
else--If it is not single-player survival mode
	Chat:sendSystemMsg("Currently not single-player survival mode!")
end

If you have any questions about Developer Tools, feel free to join our official discord server Mini World Global DEV discord

script/world_event/issurvivemode.txt · Last modified: 2024/06/01 05:08 by don