local Players = game:GetService("Players") local SoundService = game:GetService("SoundService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer --================================================== -- GUI SETUP --================================================== local screenGui = Instance.new("ScreenGui") screenGui.Name = "ClientAudioControl" screenGui.ResetOnSpawn = false screenGui.Parent = player:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Name = "MainFrame" frame.Size = UDim2.new(0, 360, 0, 390) frame.Position = UDim2.new(0.5, -180, 0.5, -195) frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) frame.BorderSizePixel = 3 frame.BorderColor3 = Color3.fromRGB(255, 0, 0) frame.Parent = screenGui --================================================== -- DRAGGING --================================================== local dragging = false local dragStart local startPosition local function updateDrag(input) local delta = input.Position - dragStart frame.Position = UDim2.new( startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y ) end frame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPosition = frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) frame.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then -- Store the input used for dragging. end end) game:GetService("UserInputService").InputChanged:Connect(function(input) if dragging and ( input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch ) then updateDrag(input) end end) --================================================== -- TITLE --================================================== local titleLabel = Instance.new("TextLabel") titleLabel.Name = "Title" titleLabel.Size = UDim2.new(1, -20, 0, 40) titleLabel.Position = UDim2.new(0, 10, 0, 5) titleLabel.BackgroundTransparency = 1 titleLabel.Text = "FE Audio Controller GUI" titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255) titleLabel.TextSize = 22 titleLabel.Font = Enum.Font.Legacy titleLabel.Parent = frame --================================================== -- RESPECT FILTERING ENABLED LABEL --================================================== local filteringLabel = Instance.new("TextLabel") filteringLabel.Name = "RespectFilteringEnabled" filteringLabel.Size = UDim2.new(1, -20, 0, 30) filteringLabel.Position = UDim2.new(0, 10, 0, 45) filteringLabel.BackgroundTransparency = 1 filteringLabel.TextSize = 18 filteringLabel.Font = Enum.Font.Legacy filteringLabel.Parent = frame local function updateFilteringLabel() local value = SoundService.RespectFilteringEnabled filteringLabel.Text = "RespectFilteringEnabled = " .. tostring(value) if value then -- Requested color: -- TRUE = RED filteringLabel.TextColor3 = Color3.fromRGB(255, 0, 0) else -- Requested color: -- FALSE = GREEN filteringLabel.TextColor3 = Color3.fromRGB(0, 255, 0) end end updateFilteringLabel() --================================================== -- BUTTON CREATION --================================================== local function createButton(name, text, yPosition) local button = Instance.new("TextButton") button.Name = name button.Size = UDim2.new(1, -20, 0, 42) button.Position = UDim2.new(0, 10, 0, yPosition) button.BackgroundColor3 = Color3.fromRGB(0, 0, 0) button.BorderSizePixel = 3 button.BorderColor3 = Color3.fromRGB(255, 0, 0) button.Text = text button.TextColor3 = Color3.fromRGB(255, 255, 255) button.TextSize = 18 button.Font = Enum.Font.Legacy button.Parent = frame return button end local playButton = createButton( "PlayAllButton", "Play All", 82 ) local stopButton = createButton( "StopAllButton", "Stop All", 128 ) local pauseButton = createButton( "PauseAllButton", "Pause All", 174 ) local loopButton = createButton( "LoopButton", "Loop All", 220 ) local spamButton = createButton( "SpamButton", "Spam All", 266 ) local lockButton = createButton( "LockButton", "Loop Stop All", 312 ) --================================================== -- SOUND FUNCTIONS --================================================== local function getAllSounds() local sounds = {} for _, object in ipairs(game:GetDescendants()) do if object:IsA("Sound") then table.insert(sounds, object) end end return sounds end --================================================== -- PAUSE POSITION STORAGE --================================================== local savedPositions = {} --================================================== -- MUTING / STOPPING --================================================== local function stopAllSounds() for _, sound in ipairs(getAllSounds()) do if sound:IsA("Sound") then sound:Stop() end end end --================================================== -- BUTTON 1: PLAY ALL --================================================== playButton.MouseButton1Click:Connect(function() for _, sound in ipairs(getAllSounds()) do if sound:IsA("Sound") then sound:Play() end end end) --================================================== -- BUTTON 2: STOP / MUTE ALL --================================================== stopButton.MouseButton1Click:Connect(function() for _, sound in ipairs(getAllSounds()) do if sound:IsA("Sound") then sound:Stop() end end end) --================================================== -- BUTTON 3: PAUSE / RESUME --================================================== local paused = false pauseButton.MouseButton1Click:Connect(function() if not paused then -- Save exact positions before stopping. savedPositions = {} for _, sound in ipairs(getAllSounds()) do if sound:IsA("Sound") then savedPositions[sound] = sound.TimePosition sound:Stop() end end paused = true pauseButton.Text = "Unpause All" else -- Restore exact positions. for sound, position in pairs(savedPositions) do if sound and sound.Parent and sound:IsA("Sound") then sound.TimePosition = position sound:Play() end end paused = false pauseButton.Text = "Pause All" end end) --================================================== -- BUTTON 4: TOGGLE LOOPED --================================================== local loopEnabled = false loopButton.MouseButton1Click:Connect(function() loopEnabled = not loopEnabled for _, sound in ipairs(getAllSounds()) do if sound:IsA("Sound") then sound.Looped = loopEnabled end end if loopEnabled then loopButton.Text = "Unloop All" else loopButton.Text = "Loop All" end end) --================================================== -- BUTTON 5: SPAM ALL AUDIOS --================================================== local spamEnabled = false local spamThread local function spamSounds() while spamEnabled do -- Play all sounds. for _, sound in ipairs(getAllSounds()) do if sound:IsA("Sound") then sound:Play() end end -- Give the sounds a moment to start. task.wait(0.05) if not spamEnabled then break end -- Stop all sounds. for _, sound in ipairs(getAllSounds()) do if sound:IsA("Sound") then sound:Stop() end end task.wait(0.01) end end spamButton.MouseButton1Click:Connect(function() spamEnabled = not spamEnabled if spamEnabled then spamButton.Text = "Unspam All" spamThread = task.spawn(spamSounds) else spamButton.Text = "Spam All" end end) --================================================== -- BUTTON 6: PERSISTENT STOP --================================================== local persistentStop = false local persistentConnection local function startPersistentStop() if persistentConnection then persistentConnection:Disconnect() end persistentConnection = RunService.Heartbeat:Connect(function() if not persistentStop then return end for _, sound in ipairs(getAllSounds()) do if sound:IsA("Sound") then if sound.IsPlaying then sound:Stop() end end end end) end lockButton.MouseButton1Click:Connect(function() persistentStop = not persistentStop if persistentStop then lockButton.Text = "Unloop Stop All" -- Immediately stop anything already playing. stopAllSounds() startPersistentStop() else lockButton.Text = "Loop Stop All" if persistentConnection then persistentConnection:Disconnect() persistentConnection = nil end end end) --================================================== -- DETECT NEW SOUNDS --================================================== -- If a new Sound is inserted while persistent stop is active, -- stop it as soon as possible. game.DescendantAdded:Connect(function(object) if object:IsA("Sound") and persistentStop then task.defer(function() if object.Parent and persistentStop then object:Stop() end end) end end) --================================================== -- KEEP FILTERING LABEL UPDATED --================================================== task.spawn(function() while screenGui.Parent do updateFilteringLabel() task.wait(1) end end)