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

How do I make a sound that plays separately for each individual player?

Asked by 9 years ago

I've already found a somewhat cheap way to do this. I inserted an invisible uncollidable part and inserted the following script:

01local debounce=false
02local sp=script.Parent
03 
04function T(hit)
05 
06local h=hit.Parent
07local p=h.Name
08local g=game:GetService("Players")
09 
10local h=g:findFirstChild(hit.Parent.Name)
11 
12if debounce==false then h.PlayerGui.Folder.Music2:Stop() end
13if debounce==false then h.PlayerGui.Folder.Music:Play() end
14debounce=true
15wait(1)
16debounce=false
17end
18script.Parent.Touched:connect(T)

There's a folder inside startergui that has all the music files I need. It stops all other music and starts up the one to be played.

This method works, but I'm searching for a better one. Please Help.

0
If it works why do you need a better one? atleast it works right. Well if there is a better option I would go for it. Hero_ic 502 — 9y
0
You still haven't explained when you want the sound to play, how many music you have, or any other relevant information. Lacryma 548 — 9y
0
On second thought the quantity does not matter. However, when do you want this to happen? Lacryma 548 — 9y
0
Have you thought about using remote events? User#3 0 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

Use GUIs, Yes I have done this many times before.

I put the sound objects into player's GUI and then play it, This way the sound is heard only to that individual player :O

Ad

Answer this question