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

How do I make a sound that only the local player can hear?

Asked by 5 years ago

I am doing a script where I activate a "Sound" with the function 'Sound: Play ()', but when it is activated it can be heard by all the players, what I want is that when the player touches the "Part" it is heard activate a "Sound" but only the player who pressed the "Part" can hear it ... I've been checking and I still can not find a way, if anyone knows please explain how I do that. Thank you for reading!

0
Play the sound form a LocalScript. That's all to it. Listen for the Touched event from the client and play the sound. User#19524 175 — 5y
0
it does not work :(, I do all the code and nothing is heard, there are no errors in the script either. xmaanzach 28 — 5y
0
What he meant........ A localscript will play a sound from workspace.... It will play only for you since it is local greatneil80 2647 — 5y
0
You can try putting the sound in game.Players.LocalPlayer since workspace will likely be serverwide. FrostyEmpire_1 0 — 5y

1 answer

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

you can use soundservice's PlayLocalSound function

game:GetService("SoundService"):PlayLocalSound(soundhere)
Ad

Answer this question