Universal Script 📌
26.6k Views
49 Executions

Anti Earrape Script

Universal Script 📌
Weavy
WeavyFirst script
3 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No 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

  1. Script edited: Create script

View Raw
--[[
    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

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
33
1
2 hours ago
Key System
Script hub
1.8M
459.6k
Bumped 3 hours ago
Key System

Script hub

#5 today

Verified script badgeAxonic Hub | 50+ Games Supported

Universal Script 📌
620
1.3k
Bumped 4 hours ago
Universal Script 📌
70
8
Approved 4 hours ago
Script hub
57
2
Approved 4 hours ago