
26.6k Views
49 Executions
Anti Earrape Script
Universal Script 📌
WeavyFirst script
3 years ago
Please login to perform these actions:Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
Basically tracks every sound instance in your game and if their PlaybackLoudness goes over the threshold will temporarily mute it until the sound maintains below the threshold. Made By: Empire4946 Updated By: Weavy
Updates
Script edited: Create script
--[[
Updated By Weavy
]]
local RunService = game:GetService("RunService")
local SoundThreshold = 700 -- Modify it to your liking [700 = default]
local originalVolumes = {}
local activeSounds = {}
local function muteSound(sound)
if not originalVolumes[sound] then
originalVolumes[sound] = sound.Volume
end
sound.Volume = 0
end
local function restoreSound(sound)
if originalVolumes[sound] then
sound.Volume = originalVolumes[sound]
originalVolumes[sound] = nil
end
end
local function updateSounds()
for _, sound in ipairs(activeSounds) do
if sound.PlaybackLoudness > SoundThreshold then
muteSound(sound)
else
restoreSound(sound)
end
end
end
local function onSoundAdded(sound)
table.insert(activeSounds, sound)
end
local function onSoundRemoved(sound)
for i, activeSound in ipairs(activeSounds) do
Comments
0Log in to join the conversation. Login
No comments yet. Be the first!







