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

How to make a sound only play for specific player(s)?

Asked by 5 years ago

So I can't really figure out how to make a sound play only for a specific player(s) and was wondering if I could get some help I tried looking on the API reference for any hints but I can't seem to find anything. Sorry if this question is a little weird but I am really having trouble, I wan't a specific sound to make only to that player when ever they press a button. So that the entire server does not here that. For example: My title screen, The music for my title screen, shop and options buttons, and much much more. All advice is very appreciated! ~SupremeStarfish

0
The simplest way would be to have the sound play through a LocalScript on the client side. As you specified that you'll be using GUI's then have the LocalScripts in the PlayerGui, then it shouldn't be replicated. Finally, make sure FE is enabled. rsublu 0 — 5y
0
Thanks rsublu SupremeStarfish 21 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Simply do

mySound:Play()

in a LocalScript, and it will only play on the client who owns that LocalScript.

https://developer.roblox.com/api-reference/class/Sound

https://developer.roblox.com/api-reference/class/LocalScript

0
Keep up the good work! SmhMate 4 — 5y
0
Yeah, that is true starmaq 1290 — 5y
0
Cool! Just a quick note, what do you mean by "and it will only play on the client who owns that LocalScript." Like do you mean the script is PHYSICALLY in the player? Or do i just put it in starter gui? SupremeStarfish 21 — 5y
0
In the player, in the StarterGUI, in StarterPack, as long as it's in something associated with the player, it won't even run otherwise. davidgingerich 603 — 5y
Ad

Answer this question