PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

BindableEvent Hello World

BindableEvent Hello World

Oct 01 2018, 2:56 AM PST

This code sample defines and connects a simple function to a BindableEvent. It then fires the BindableEvent, which in turn calls the connected function. It prints “Hello, world”. Test this script by pasting it into a BindableEvent within the Workspace or ServerScriptService.

local be = script.Parent

-- Define a simple function to connect
-- to the custom event
local function onEvent(...)
	print(...)
end
be.Event:Connect(onEvent)

-- Fire the event
be:Fire("Hello, world")