User Tools

Site Tools


script:world_event:randomoneplayer

randomOnePlayer


  • Parameters and types:
    • alive: numberplayer status (0 means dead, 1 means alive, default -1 means all players)
  • Return value and type:
    • code: numberSuccess (ErrorCode.OK) ErrorCode
    • playerid: numberplayerUin
  • The main function of this method: Randomly obtain a player
  • The specific use cases are as follows:
--Randomly select a player from all players
--Parameters: -1 all players 0 dead players 1 alive players
local result,playerid=World:randomOnePlayer(-1)
--Display in the chat box
Chat:sendSystemMsg("Randomly selected a player:"..playerid)
script/world_event/randomoneplayer.txt · Last modified: 2024/06/04 04:18 by don