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

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

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

local debounce=false
local sp=script.Parent

function T(hit)
	
local h=hit.Parent
local p=h.Name
local g=game:GetService("Players")

local h=g:findFirstChild(hit.Parent.Name)

if debounce==false then h.PlayerGui.Folder.Music2:Stop() end
if debounce==false then h.PlayerGui.Folder.Music:Play() end
debounce=true
wait(1)
debounce=false
end
script.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.

4 comments

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.

0

You still haven't explained when you want the sound to play, how many music you have, or any other relevant information.

0

On second thought the quantity does not matter. However, when do you want this to happen?

0

Have you thought about using remote events?

1 answer

✓ Accepted answer

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

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