Skip to content

replicatesignal

Signal arguments must match

Some signals require specific argument structures. If incorrect arguments are passed, an error must be thrown.

Notes on replicatesignal

For an accurate result from the examples, test the function in our game.

If possible, replicates the signal to the server with the provided arguments. The arguments must also match accordingly to the signal itself. To know a signal's arguments, visit this.

function replicatesignal(signal: RBXScriptSignal, ...: any?)

Parameters

Parameter Description
signal The signal to replicate to the server.
...? Arguments to pass to the signal.

Examples

Example 1

Replicating a ClickDetector interaction
1
2
3
4
5
local detector = workspace.replicatesigmal.ClickDetector
replicatesignal(detector.MouseActionReplicated, game.Players.LocalPlayer, 0)
task.wait(0.1)

print(game.Players.LocalPlayer:GetAttribute("MouseClickReplicated")) -- Output: true

Example 2

Incorrect argument usage
local ui_frame = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame

-- These will throw an error.
replicatesignal(ui_frame.MouseWheelForward)
replicatesignal(ui_frame.MouseWheelForward, 121)

-- This succeeds
replicatesignal(ui_frame.MouseWheelForward, 121, 214)
task.wait(0.1)

print(game.Players.LocalPlayer:GetAttribute("MouseWheelForwardReplicated")) -- Output: true