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

How to make a sound only audible to one player?

I was browsing through ScriptingHelpers to find a solution to my problem, and only found this result.

However this did not work, even in the testing environment in studio, and in-game.

What solution would there be that actually works?

1 comment

0

youl could also use: SoundService:PlayLocalSound(soundObject)

1 answer

✓ Accepted answer

put this in a roblox localscript

local sound = Instance.new("Sound", workspace)
sound.SoundId = "rbxassetid://IDHERE"
sound.Playing = true
sound.Looped = true
  • how to test this works
if game.Players.LocalPlayer.Name == "YOURNAME" then
local sound = Instance.new("Sound", workspace)
sound.SoundId = "rbxassetid://IDHERE"
sound.Playing = true
sound.Looped = true
end
  1. get a player to join
  2. you join, see if they can hear the sound

you can use this on events, the sound on plays to the player if its in a local script.

3 comments

0

Hmm, but this ended up playing it to the server, not a sole player.

0

are you sure? It's a localscript it shouldn't - try an event to fire the sound script (1st).

0

Oh, sorry, my friend tried playing audio at the same time as me. It worked :)! Thanks!

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