User Tools

Site Tools


script:ui_event:setstate

setState

  • Parameters & Types:
    • playerid: number player ID
    • uiid: the ID of the string interface
    • elementid: the ID of the string component
    • pageIndex: the value of the string state
    • effectid:number action enumeration LinearTransformation.None or LinearLinearTransformation
    • time:number animation event (default)
  • Return value and type:
    • ErrorCode. OK
  • The main function of this method is to switch the page state
  • Specific use cases are as follows:
--This function is executed when the player clicks on the block
local function clickblock(event)
    local playerid=event.eventobjid--Click on the player's mini number of the block
    local uiid="6997615793455979871"--Interface ID
    local statename="6997615793455979871-Foundation Page 1"-- Page status
    --Toggle the player's page status
    Customui:setState(playerid, uiid, statename)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
script/ui_event/setstate.txt · Last modified: 2024/06/11 03:36 by don