Player:hideUIView(playerid, uiid) API Description The main function of this method: hide a UI interface for a player.
Parameters | Types | Info |
---|---|---|
playerid | number | Player ID |
uiid | string | The ID of the interface to hide |
Return Value | Type |
---|---|
ErrorCode.OK (0) | number |
-- When a player clicks a block, execute this function local function clickblock(event) local uin = event.eventobjid -- The player ID who clicked the block local uiid = "6986982063319417057" -- Replace with your actual UI ID Player:hideUIView(uin, uiid) -- Hide the interface for the player end -- Register event for Player.ClickBlock ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
This Lua code triggers when a player clicks a block, hiding a specified UI interface.
local function clickblock(event)
Declares a function named clickblock for the Player.ClickBlock event.
event parameter contains game event data.
local uin = event.eventobjid
Extracts the player’s account ID from the event object.
local uiid = "6986982063319417057"
Defines the interface ID to hide.
Important: Replace this placeholder with your actual UI ID.
Player:hideUIView(uin, uiid)
Calls the Player API to hide the UI for the target player.
Parameters:
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
Binds the clickblock function to the Player.ClickBlock event.
Key concepts demonstrated:
Result: The specified UI hides when a player clicks any block.
Remember to: