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

How do I play an audio only one person can here?

Asked by
neoG457 315 Moderation Voter
9 years ago
game.Workspace.Sound:Play()

The sound in workspace plays but everyone can hear it, it's meant to be for the introduction to my game. Please help

1 answer

Log in to vote
2
Answered by
DevChris 235 Moderation Voter
9 years ago

Do it in a LocalScript. Right-click on StarterGui and then click LocalScript. Then you can do (assuming you aren't used to FilteringEnabled or StarterPlayer):

local sound = Instance.new("Sound", game.Players.LocalPlayer)
sound.Name = "MySound"
sound.Volume = 1 --Sound Volume (0-1)
sound.Pitch = 1 --SoundPitch (0-1)
sound.SoundId = "http://www.roblox.com/asset/?id=".. YourSoundId --Add your Sound ID
sound:Play()
Ad

Answer this question