local Players = game:GetService("Players") local Player = Players.LocalPlayer local PlayerGui = Player:WaitForChild("PlayerGui") if PlayerGui:FindFirstChild("SoundSpyUI") then PlayerGui.SoundSpyUI:Destroy() end local ScreenGui = Instance.new("ScreenGui") local MainFrame = Instance.new("Frame") local ScrollingFrame = Instance.new("ScrollingFrame") local UIListLayout = Instance.new("UIListLayout") local Title = Instance.new("TextLabel") local SearchBar = Instance.new("TextBox") local ClearBtn = Instance.new("TextButton") -- UI Setup (Compact) ScreenGui.Name = "SoundSpyUI" ScreenGui.Parent = PlayerGui ScreenGui.ResetOnSpawn = false MainFrame.Name = "MainFrame" MainFrame.Parent = ScreenGui MainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20) MainFrame.BorderSizePixel = 0 MainFrame.Position = UDim2.new(0.8, 0, 0.4, 0) MainFrame.Size = UDim2.new(0, 180, 0, 250) -- Much smaller width/height MainFrame.Active = true MainFrame.Draggable = true -- The whole frame is draggable via the title area Title.Parent = MainFrame Title.Size = UDim2.new(1, 0, 0, 25) Title.BackgroundColor3 = Color3.fromRGB(35, 35, 35) Title.Text = "🔊 SOUND SPY" Title.TextColor3 = Color3.fromRGB(255, 255, 255) Title.TextSize = 12 Title.Font = Enum.Font.SourceSansBold SearchBar.Name = "SearchBar" SearchBar.Parent = MainFrame SearchBar.Position = UDim2.new(0, 5, 0, 28) SearchBar.Size = UDim2.new(1, -10, 0, 20) SearchBar.BackgroundColor3 = Color3.fromRGB(40, 40, 40) SearchBar.PlaceholderText = "Search..." SearchBar.Text = "" SearchBar.TextColor3 = Color3.fromRGB(255, 255, 255) SearchBar.TextSize = 12 SearchBar.Font = Enum.Font.SourceSans ScrollingFrame.Parent = MainFrame ScrollingFrame.Position = UDim2.new(0, 0, 0, 52) ScrollingFrame.Size = UDim2.new(1, 0, 1, -80) ScrollingFrame.BackgroundTransparency = 1 ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0) ScrollingFrame.ScrollBarThickness = 3 UIListLayout.Parent = ScrollingFrame UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder UIListLayout.Padding = UDim.new(0, 3) ClearBtn.Parent = MainFrame ClearBtn.Position = UDim2.new(0, 5, 1, -25) ClearBtn.Size = UDim2.new(1, -10, 0, 20) ClearBtn.BackgroundColor3 = Color3.fromRGB(100, 30, 30) ClearBtn.Text = "CLEAR" ClearBtn.TextColor3 = Color3.fromRGB(255, 255, 255) ClearBtn.TextSize = 12 ClearBtn.Font = Enum.Font.SourceSansBold -- Search Logic SearchBar:GetPropertyChangedSignal("Text"):Connect(function() local filter = SearchBar.Text:lower() for _, frame in pairs(ScrollingFrame:GetChildren()) do if frame:IsA("Frame") then local name = frame:FindFirstChild("SoundName") and frame.SoundName.Text:lower() or "" frame.Visible = name:find(filter) ~= nil end end end) ClearBtn.MouseButton1Click:Connect(function() for _, child in pairs(ScrollingFrame:GetChildren()) do if child:IsA("Frame") then child:Destroy() end end end) local function AddSoundToList(sound) local id = sound.SoundId:match("%d+") or "0" local existing = ScrollingFrame:FindFirstChild(sound.Name..id) if existing then existing.LayoutOrder = -tick() return end local SoundFrame = Instance.new("Frame") local NameLabel = Instance.new("TextLabel") local CopyBtn = Instance.new("TextButton") local PlayBtn = Instance.new("TextButton") SoundFrame.Name = sound.Name..id SoundFrame.Size = UDim2.new(1, -5, 0, 30) -- Smaller list items SoundFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40) SoundFrame.BorderSizePixel = 0 SoundFrame.Parent = ScrollingFrame SoundFrame.LayoutOrder = -tick() NameLabel.Name = "SoundName" NameLabel.Parent = SoundFrame NameLabel.Size = UDim2.new(0.6, 0, 1, 0) NameLabel.BackgroundTransparency = 1 NameLabel.Text = " " .. sound.Name NameLabel.TextColor3 = Color3.fromRGB(200, 200, 200) NameLabel.TextSize = 10 NameLabel.TextXAlignment = Enum.TextXAlignment.Left NameLabel.ClipsDescendants = true PlayBtn.Parent = SoundFrame PlayBtn.Position = UDim2.new(0.65, 0, 0.15, 0) PlayBtn.Size = UDim2.new(0.15, 0, 0.7, 0) PlayBtn.BackgroundColor3 = Color3.fromRGB(50, 120, 50) PlayBtn.Text = "▶" PlayBtn.TextColor3 = Color3.fromRGB(255, 255, 255) CopyBtn.Parent = SoundFrame CopyBtn.Position = UDim2.new(0.82, 0, 0.15, 0) CopyBtn.Size = UDim2.new(0.15, 0, 0.7, 0) CopyBtn.BackgroundColor3 = Color3.fromRGB(40, 80, 120) CopyBtn.Text = "ID" CopyBtn.TextColor3 = Color3.fromRGB(255, 255, 255) CopyBtn.TextSize = 10 PlayBtn.MouseButton1Click:Connect(function() local s = Instance.new("Sound", game.Workspace) s.SoundId = "rbxassetid://"..id s.Volume = 1 s:Play() game:GetService("Debris"):AddItem(s, 5) end) CopyBtn.MouseButton1Click:Connect(function() setclipboard(id) CopyBtn.Text = "OK" task.wait(1) CopyBtn.Text = "ID" end) ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, UIListLayout.AbsoluteContentSize.Y) end local function hookSound(v) if v:IsA("Sound") then v:GetPropertyChangedSignal("Playing"):Connect(function() if v.Playing then AddSoundToList(v) end end) v.Played:Connect(function() AddSoundToList(v) end) if v.Playing then AddSoundToList(v) end end end for _, v in pairs(game:GetDescendants()) do pcall(hookSound, v) end game.DescendantAdded:Connect(function(v) pcall(hookSound, v) end)