Skip to content

API > MLClickable > OnClick


MLClickable.OnClick⚓︎

Read-Only

Read-only Property This property is Read-Only

Name Type
OnClick EventHandler

Event callback function requirement⚓︎

Info

This property is an event. It means that you need to add a listener function to it. Here how that function needs to look like.

function(MLPlayer player);

Parameters⚓︎
Name Type Description
player MLPlayer The Player who clicked it

Usage⚓︎

--- @type 
local mlclickable;

--- callback function called when event triggers
--- @param mlplayer MLPlayer
local function CallBack(mlplayer)
    -- code to handle event call back
end


-- Regsiter callback function
mlclickable.OnClick.Add(CallBack);

Description⚓︎

Event which will trigger when player clicks the object.