User Tools

Site Tools


script:ui_event:settext

setText

  • Parameters & Types:
    • playerid: number player ID
      • uiid: the ID of the string interface
    • elementid: the ID of the string component
    • text: string
    • animid:number animation ID (default parameter)
    • time: number animation duration (default parameter)
    • mode: number playback mode (default)
  • Return value and type:
    • ErrorCode. OK
  • The main purpose of this method is to set the content of the text symbol
  • 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="6986982063319417057"--Interface ID
    local elementid="6986982063319417057_1"--Text element id
    local text="Hello"-- The text content to be set
    --Set the display of the player's text symbols
    Customui:setText(playerid, uiid, elementid, text)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
script/ui_event/settext.txt · Last modified: 2024/06/11 02:17 by don