How would i make a Volume limit in a sound

How would i made a audio limit like in parkour so people cant play Really loud music?

If i understand your question right?. You could use “math.clamp()” to clamp the audios volume.

1 Like

There is a property labelled PlaybackLoudness on the sound instance. That value is between 0-1000 with the current loudness of the sound.

1 Like

Your answer isn’t contributive as that’s the standard limit, but without custimzation or control over the sound limit.

You can use that information to write a script that lowers the volume based on that property.

1 Like

Heres an example i just took for what i mean.

Yes, but what if the OP lets the control over the clients? Sometimes, clients may put in a massive number.

I really don’t get what you meant. Do you meant by those color changing bar?

No no, stopping loud audios from being played. Lets say it will force stop once it reaches a certain decibel (example)

Well, you can do a checking on the server with the sound loudness, if it passes the limit, you could delete the sound instance.

Clients cannot change PlaybackLoudness its based off how loud the actual audio is.

Then I don’t have any ideas other than you have to manually blacklist that audio by yourself.

you can lower the volume value i think

No what I’m saying is that that property is perfect for what OP wants.

if Sound.PlaybackLoudness > 500 then
Sound:Stop()
end
2 Likes

I was thinking the same thing for this i just didnt know if it was this simple, or if i had to create something to check for me.

Just trial and error the max loudness until you get the value you want.

I will be trying this now.

(Character limit)

1 Like

If you not adding this to a functioned script you need to do that.

while true do
wait()
if script.Parent:FindFirstChild(“Sound”) then
if script.Parent.Sound.PlaybackLoudness > 500 then
script.Parent.Sound:Stop()
end
end

Sorry if I’ve mistaken your topic.

I’d rather use heartbeat for this but thats a personal thing and i think it would work a lot better.