I am trying to make a sound disable for a single player, but everyone else on the server would be able to hear that sound.
COMMUNITY QUESTION
How can I make a sound be disabled for 1 player?
1 answer
Here's what I would do:
In Explorer, click 'Workspace' and check FilteringEnabled.
Now, make a Script in Workspace:
local sound = game.Workspace.Sound -- Replace this 'game.Workspace.Sound' with the sound.
local playerToHideSound = 'PlayerName' -- Replace 'PlayerName' with the name of the player.
game.Players.PlayerAdded:connect(function(plr)
sound:Play() -- I do this because players might miss the sound.
if plr.Name == playerToHideSound then
script.SoundStopScript:Clone.Parent = plr.PlayerGui
end
end
Now, make a LocalScript inside the script called SoundStopScript, and put in:
local sound = game.Workspace.Sound -- Replace this 'game.Workspace.Sound' with the sound.
sound:Stop()
This will not 100% work, but if it does work, please accept my answer.
This discussion is preserved as it was. New answers, comments, and votes are closed.
