RemoteEvent:FireOtherClients - Locally fire other clients

This might seem abit counter intuitive at first, but many times I use remote events to create items locally on each clients computer instead of creating 1 object at the server.

Bullets, arrows etc. all run locally for best performance.
This involves sending a FireServer from a client and on the server it has to go through the playerlist and call FireClient on everyone except the player who initially fired the event.

It would feel more streamlined to have a simple: event:FireOtherClients method available for localscripts.
Note: This would also fire on the server so you could make sure the call is legit.

6 Likes

TLDR: I would rather vote for a :FireAllClientsExcept(Player player, ...) that fires to all but player, although that would still be a very low priority feature to me.


Note that if this was implemented, all communication would still run through the server since clients do not have a direct connection with other clients. So the only benefit would be in terms of writing a little bit less code.

Also, if you find out that the event is not legit at the server, how do you stop it from replicating to other clients? Would the events have to have a UUID and you could cancel them using another API?(!) I think any code/API that would be conjured for that concept would be more awkward than the current situation.

If anything, I would rather argue for a :FireAllClientsExcept(Player player, ...) or similar name, because then it is more explicit that the communication still happens through the server, and you don’t have to change much of your code (you just remove a bit of server-side code), as well as being able to do your server-side checks in a way that isn’t as awkward.

10 Likes

Except players instead of player, would allow for the server to communicate with lets say 1 team or a group of players instead of everyone but 1.

I would rather we don’t allow clients to send whatever they want to other clients without having access to it on the server.

Note: This would also fire on the server so you could make sure the call is legit.

It would already have gone to the other clients making checking useless

unless the server has a way to delay it until it’s checked, at which point you may as well just be using FireServer

1 Like

This is technicly possible by going from the client “FireServer()” then in the server “.OnServerEvent” and then “FireClient()” on the same event and then in the client doing “.OnClientEvent”.

Neglecting the fact that this thread is 5 months old, I believe you missed the point of the post. There were never any functionality issues - OP was simply suggesting adding another event that satisfies a common use case (Firing all clients other than the one that triggered the event in the first place), though I disagree with the Client -> Client communication - it should definitely still be Client -> Server -> all other clients.

1 Like

I know that, im just saying thats a way to do it.

Execution of this isn’t the issue, it was simply a thread based around adding efficiency.

Also, as @Chaotic_Cody said, this should be a server-sided call anyhow.