Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I play a sound for everyone in the server except for the client?

I'm trying to make a gun play a sound for the client first, then for the server to reduce replication lag. This however causes the 2 sounds to overlap, so I'm trying to make the sound play for everyone else on the server-side, except for the client.

3 answers

✓ Accepted answer

Put 2 different sounds for client and server. Then, turn the volume to 0 on the server one with the LocalScript.

4 comments

0

this causes a double effect which is what im not looking for, thanks for helping though!

0

I got some solutions that might not work. Create 2 separate sounds for the client and server or turn the volume to 0 on one.

0

this might actually work... let me get on studio

0

the turn on volume 0 for the server sound on the localscript was the one that worked! due to your help, I was able to also implement serversided flash fx and many other things. YOU are a legend!!!!!!

You should just make a remote function/event that goes to all clients and ignore the player firing it; I feel like that's the best way to do it unless if you really want to do it on the server.

2 comments

0

how do I make a remote event that excludes the client? thx.

0

for _, player in pairs(game.Players:GetPlayers()) do if player.UserId ~= blacklistedUserId then noiseEvent:FireClient(player) end end

Either send the signal to only the other players or send a playername and if localplayername is the playername then ignore

2 comments

0

I know but how do I do that can u please show me an example thanks

0

like .OnServerEvent(player,animation) then :FireAllClients(animation,player) then .OnClientEvent if player ~= localplayer then animation:Play()

This discussion is preserved as it was. New answers, comments, and votes are closed.