VoltSignal:Fire

Fires the signal with the given arguments.

Syntax

VoltSignal:Fire(...: any) -> ()

Parameters

ParameterTypeDescription
...anyArguments to pass to connected handlers

Returns

This method does not return a value.

Description

VoltSignal:Fire triggers all connected handlers and resumes any threads waiting on the signal. All provided arguments are passed to each handler and returned by Wait.

Fire is exposed only on signals that scripts are allowed to fire, including values created by VoltSignal.new() and LuaStateProxy.Event. Internal read-only signals such as on_actor_state_created do not expose it.

Example

local signal = VoltSignal.new()

signal:Connect(function(a, b, c)
    print(a, b, c)
end)

-- Fire with multiple arguments
signal:Fire("hello", 42, true)
-- Output: hello 42 true

Firing Without Arguments

local onComplete = VoltSignal.new()

onComplete:Connect(function()
    print("Task completed!")
end)

onComplete:Fire()
-- Output: Task completed!

Firing With Tables

local onDataReceived = VoltSignal.new()

onDataReceived:Connect(function(data)
    print("Received:", data.name, data.value)
end)

onDataReceived:Fire({ name = "Score", value = 100 })
-- Output: Received: Score 100