RemoteSignal
Created via ServerComm:CreateSignal()
.
Functions
Connect
Types
interface
Connection {
Disconnect:
(
)
→
nil
Connected:
boolean
}
Connect a function to the signal. Anytime a matching ClientRemoteSignal on a client fires, the connected function will be invoked with the arguments passed by the client.
Fire
RemoteSignal:
Fire
(
...:
any
--
Arguments passed to the client
) →
(
)
Fires the signal at the specified client with any arguments.
Outbound Middleware
All arguments pass through any outbound middleware (if any) before being sent to the clients.
FireAll
RemoteSignal:
FireAll
(
...:
any
) →
(
)
Fires the signal at all clients with any arguments.
Outbound Middleware
All arguments pass through any outbound middleware (if any) before being sent to the clients.
FireExcept
RemoteSignal:
FireExcept
(
...:
any
--
Arguments passed to the other clients
) →
(
)
Fires the signal to all clients except the specified client.
Outbound Middleware
All arguments pass through any outbound middleware (if any) before being sent to the clients.
FireFilter
RemoteSignal:
FireFilter
(
...:
any
--
Arguments to pass to the clients (and to the predicate)
) →
(
)
Fires the signal at any clients that pass the predicate
function test. This can be used to fire signals with much
more control logic.
Outbound Middleware
All arguments pass through any outbound middleware (if any) before being sent to the clients.
Predicate Before Middleware
The arguments sent to the predicate are sent before getting transformed by any middleware.
-- Fire signal to players of the same team:
remoteSignal:FireFilter(function(player)
return player.Team.Name == "Best Team"
end)
FireFor
Fires a signal at the clients within the players
table. This is
useful when signals need to fire for a specific set of players.
For more complex firing, see FireFilter
.
Outbound Middleware
All arguments pass through any outbound middleware (if any) before being sent to the clients.
local players = {somePlayer1, somePlayer2, somePlayer3}
remoteSignal:FireFor(players, "Hello, players!")
Destroy
RemoteSignal:
Destroy
(
) →
(
)
Destroys the RemoteSignal object.