Hello
I want everybody in the server to hear a sound (not related to a position).
Does it matter if I play it on the server or is it better to send remotes to clients to play it themselves?
Do I negatively impact the server from performance point of view in the first case?
It is usually alright to play such sounds from the server, since it is a 2D sound and not a 3D one, so the load on the server will be less. However, you can replicate it to clients using FireClient and this will take the whole load off the server, granting you some performance boost. My current system is set up in such a way that I can play the sound both on server and client using RemoteEvents. This gives me some flexibility. Usually i just replicate it to the client, however any criticism is welcome.
Serversided sounds, when played, replicate to all clients, regardless of whether or not they are far away, or are parented in a non-positional object like a Part. This is good for ambient sounds, vehicle sounds, character sounds, and any sound that all players have to hear simultaneously. However, syncing could be a bit of an issue when sounds play, since not all users will hear sounds at the exact time.
Take for example, you make a script that plays sounds on all parts that move physically, and has touched another part (something like BrickClatter from a decade ago, now long gone). This could cause some syncing problems, especially when the parts appear to not be moving, but you still hear them making noise.
If your sound doesn’t need to be played to clients at the same time, you’ve got nothing to worry about.
I’d also like to point out that it doesn’t increase server load to any measurable degree, regardless of 2d/3d. And the syncing won’t be terribly bad and in the majority of cases it won’t matter. You can trigger the sound from the client instead to do manual syncing, but you’d need something like a gun firing effect happening on the client to trigger it. If you just expect to start it on the client after a remote event is fired, it won’t be synced with anything. Still don’t let that deter you, in most cases it doesn’t matter enough.