GetEvent||doc136766

September 20, 2022

Format

Window:GetEvent(eventName)

Describe

Gets the window instance event.

parameter

Variable name Type Describe
eventName string Event name

Return value

Type Describe
BindableEvent Bindable events

Code example

Get the bindable event of window clicking, bind the function, and print the information each time you click.

local winShop = UI:CreateGUIWindow("testShop")
local buyBtn = winShop.buyBtn
local bindableEvent = buyBtn:GetEvent("OnClick")

bindableEvent:Bind(function()
    print("onClick")
end)