Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

0
this causes a double effect which is what im not looking for, thanks for helping though! Vexanonymous 6 — 3y
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. CandyWreckEpicness 115 — 3y
0
this might actually work... let me get on studio Vexanonymous 6 — 3y
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!!!!!! Vexanonymous 6 — 3y
Ad
Log in to vote
1
Answered by
spectsy 16
3 years ago

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.

0
how do I make a remote event that excludes the client? thx. Vexanonymous 6 — 3y
0
for _, player in pairs(game.Players:GetPlayers()) do if player.UserId ~= blacklistedUserId then noiseEvent:FireClient(player) end end Speedmask 661 — 3y
Log in to vote
0
Answered by
sayer80 457 Moderation Voter
3 years ago

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

0
I know but how do I do that can u please show me an example thanks Vexanonymous 6 — 3y
0
like .OnServerEvent(player,animation) then :FireAllClients(animation,player) then .OnClientEvent if player ~= localplayer then animation:Play() sayer80 457 — 3y

Answer this question