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

RenderStepped script not printing when audio playbackloudness goes over limit?

local RunService = game:GetService("RunService")
 local sound = script.Parent.Sound
local player = game.Players.LocalPlayer
local radio = script.Parent

RunService.RenderStepped:Connect(function()
	local pbl = sound.PlaybackLoudness
	while wait() do
	if pbl >=200 then
		print("too loud")
	end
	end
end)

1 answer

You dont need to use a while wait() do

All you need is the run service function but I would advice RunService.Heartbeat Try this:

local RunService = game:GetService("RunService")
local sound = script.Parent.Sound
local player = game.Players.LocalPlayer
local Radio = script.Parent
local plb = sound.PlaybackLoudness

RunService.Heartbeat:Connect(function()
	if plr > 200 then
		warn("To Loud") --This is becase warns look better in my opinion
	end
end)

3 comments

0

Too*

0

what does warn do? I've never seen it before and the wiki dident really explain or say what it does

0

also still doesent work doesent print

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