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?
If you are referring to a stealth skill, you should lower the player’s sounds from the server side, that way they will be quieter to everyone else.
Instead of inserting SoundEffects into every sound on a client, you should consider adding all the player’s sounds to a SoundGroup. Any sound effect that is a descendant of the sound group will be applied to all the sounds in that group.
local Event = game.ReplicatedStorage.Event
Event.OnClientEvent:Connect(function()
for i, v in pairs(soundfolder:GetChildren()) do
if v.ClassName == "Sound" then
v.Volume = 0
end
end
end)
This has to be in a local script.
In the server (the skill script) FireClient the event to the Target
local Event = game.ReplicatedStorage.Event
Event:FireClient(Target)