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

How to turn down the sound of a single client in the game?

I am making a skill that turns down the sound of a target, making it deaf, but I have no clue in how to do this. It could be a simple way to allow the user to turn down the sound ingame too.

And also if not asking too much, is it possible to put a Sound Effect in all the sounds heared by the one's client?

1 answer

You can turn down the sound of a player with remote events.

Example

Server script

local Players = game:GetService("Players")
local Remote = game.ReplicatedStorage.RemoteEvent


local function Added(Player)
	wait(3)
	if Player.Name == "Player2" then
		Remote:FireClient(Player) --fire remote to make deaf player
	end
end

Players.PlayerAdded:Connect(Added)

Client script

local Remote = game.ReplicatedStorage.RemoteEvent
local Player = game.Players.LocalPlayer

script.Parent.Sound:Play()

Remote.OnClientEvent:Connect(function()
	script.Parent.Sound:Stop() --deafs player 2
	warn("Stopped sound for: ".. Player.Name) 
end)

Dont just copy it, make sure you understand it, if you have any questions just comment it and ill asnwer.

2 comments

0

Man, i know how to use Remote events pretty well, I have made big working games already. As you know, if do what you tell, the sound will not turn off. I don't want a warn saying the sound is turned off, i want the sound to turn off. What I want to know is what could I put inside the function.

0

That makes no sense, i literally showed you how to "deaf" a specific player. Read the entire script.

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