BindableEvent

BindableEvent : Instance

Properties

Methods

Fire

Fire the event with Argument.

Parameters

Tuple Arguments

Return

void

Code Samples

-- Script1 (or LocalScript1)
local ServerScriptService = game:GetService("ServerScriptService")
local BindableEvent = ServerScriptService:WaitForChild("BindableEvent")

local function SomeEvent(text)
    print("[SomeEvent]", "Parameter : ", text)
end
BindableEvent.Event:Connect(SomeEvent)


-----------------------------------------------------------------------------------
-- Script2 (or LocalScript2)
local ServerScriptService = game:GetService("ServerScriptService")
local BindableEvent = ServerScriptService:WaitForChild("BindableEvent")

local SomeText = "BindableEvents"
BindableEvent:Fire(SomeText) -- Passing arguments

Events

Event

The Event represents the signal that is fired when the BindableEvent is triggered using the Fire method. Any connected functions to this event will be called, allowing scripts to respond to the event with any arguments that were provided when firing the event.

Parameters

Code Samples

local ServerScriptService = game:GetService("ServerScriptService")
local BindableEvent = ServerScriptService:WaitForChild("BindableEvent")

local function SomeEvent(text)
    print("[SomeEvent]", "Parameter : ", text)
end
BindableEvent.Event:Connect(SomeEvent)

Last updated