RemoteSignal v1.1 - A simple module for sending Remote Events to Multiple Clients!

There’s probably a million similar modules compared to this one, but in any case…

RemoteSignal

Is a small module that allows you to send multiple Remote Events to clients.
It also has a warn system that tells you what went wrong.

How to use it:

local RemoteSignal = require(game.ReplicatedStorage.RemoteSignal)

--[-[ Fires an event to a single player ]-]
RemoteSignal:FireClient(RemoteEventInstance, Player, [your own arguments])

--[-[ Fires an event to a multiple players ]-]
RemoteSignal:FireMultipleClients(RemoteEventInstance, Table(specifically players), [your own arguments])

--[-[ Fires an event to all of the players except to a specific player/s ]-]
RemoteSignal:FireAllClientsExcept(RemoteEventInstance, Player or Table, [your own arguments])

--[-[ Fires an event to all of the players ]-]
RemoteSignal:FireAllClients(RemoteEventInstance, [your own arguments])

Additional Notes:
Make sure you insert nothing but players in the table when firing multiple clients

Get the model down below:

Questions and Answers

What is the point of the FireClients and FireAllClients when it already exists?
Those functions are redundant if you prefer to use the existing ones but, i’ve included them anyway just in case anyone wants to use the module entirely.

Does this have a performance impact?
No. In fact, I don’t believe it has any performance impact at all because of how simple the module functions. I have performed various tests and its blazingly fast.

This module is super basic, why even share it?
It is down to the user whether they would want to use it. Its more of a Quality Of Life feature really, its just there.

What licence does this use?
MIT

Why have these separately if they do the same?

They don’t do the same thing.

RemoteSignal:FireAllClientsExcludeOne(RemoteEventInstance, Player, [your own arguments])

Only accepts the player object.

--[-[ Fires an event to all of the players except to a group of players ]-]
RemoteSignal:FireAllClientsExcept(RemoteEventInstance, Table(specifically players), [your own arguments])

While this accepts a table of players.

Technically, if you pass a single table value it will function the same, however you might as well just insert the player object itself instead of creating a new table or referencing an old one.

I separated them for the sake of not having to make a new table (which I know is not that hard lol)

It depends which one you would rather use.

1 Like

Why not just let FireAllClientsExcept accept a Player (as well as an array of players) as an argument?

I have updated the module and removed the redundant function:

RemoteSignal:FireAllClientsExcludeOne()

Changed:

RemoteSignal:FireAllClientsExcept()

It now accepts player and table values

So yeah, I just realized I could have let the function accept a player value as well. silly me lol

1 Like

I think that using varargs (or whatever its name is in Lua) is a better idea, it’s more consistent. You also won’t need to check the type, which makes it faster.

Varargs are more suitable for the RemoteEvent data to supply that come after the player argument, since vargs are the last.

Also, it doesn’t make sense to unpack() an array of players whenever we want to use the function, and then have the function re-pack it again ({...}) internally to iterate through the players. This is unnecessary and doesn’t really help in terms of performance either.

1 Like