I made a script that creates a TextButton with Instance.new() and connects an event to the button.
local gui = Instance.new("ScreenGui")
local frame = Instance.new("Frame")
local nobutton = Instance.new("TextButton")
local yesbutton = Instance.new("TextButton")
local watermark = Instance.new("TextLabel")
local warning = Instance.new("TextLabel")
gui.Name = "Emergency Music Clear"
gui.Parent = plr.PlayerGui
frame.BorderColor3 = Color3.fromRGB(255,0,0)
frame.BorderSizePixel = 5
frame.BackgroundColor3 = Color3.fromRGB(0,0,0)
frame.BackgroundTransparency = 0.5
frame.Position = UDim2.new(0.5,-125,0.5,-50)
frame.Size = UDim2.new(0,250,0,100)
frame.Parent = gui
--VVButton TWO
nobutton.Name = "Cancel"
nobutton.BackgroundColor3 = Color3.fromRGB(255,90,90)
nobutton.BorderColor3 = Color3.fromRGB(255,0,0)
nobutton.BorderSizePixel = 4
nobutton.Position = UDim2.new(0.7,-25,0.8,-12)
nobutton.Size = UDim2.new(0,50,0,25)
nobutton.FontSize = Enum.FontSize.Size14
nobutton.Text = "Cancel"
nobutton.TextStrokeTransparency = 1
nobutton.Font = Enum.Font.SourceSansBold
nobutton.Parent = frame
nobutton.TextColor3 = Color3.fromRGB(0,0,0)
--VVButton ONE
yesbutton.Name = "Cancel"
yesbutton.BackgroundColor3 = Color3.fromRGB(44,88,0)
yesbutton.BorderColor3 = Color3.fromRGB(27,42,53)
yesbutton.BorderSizePixel = 0
yesbutton.Position = UDim2.new(0.3,-25,0.8,-12)
yesbutton.Size = UDim2.new(0,50,0,25)
yesbutton.FontSize = Enum.FontSize.Size14
yesbutton.Text = "Confirm"
yesbutton.TextStrokeTransparency = 1
yesbutton.Font = Enum.Font.SourceSansBold
yesbutton.Parent = frame
yesbutton.TextColor3 = Color3.fromRGB(0,0,0)
watermark.Name = "Watermark"
watermark.BackgroundTransparency = 1
watermark.Position = UDim2.new(0.1,0,-0.15,0)
watermark.Size = UDim2.new(0,200,0,50)
watermark.Font = Enum.Font.SciFi
watermark.FontSize = Enum.FontSize.Size18
watermark.Text = "TroiTech"
watermark.TextColor3 = Color3.fromRGB(189,255,253)
watermark.Parent = frame
warning.Name = "Warning"
warning.BackgroundTransparency = 1
warning.Position = UDim2.new(0.1,0,0.1,0)
warning.Size = UDim2.new(0,200,0,50)
warning.Font = Enum.Font.SourceSansItalic
warning.FontSize = Enum.FontSize.Size24
warning.Text = "Remove global sounds?"
warning.TextColor3 = Color3.fromRGB(255,255,255)
warning.Parent = frame
warning.TextWrapped = true
nobutton.MouseButton1Down:connect(function()
print("Decline")
gui:Destroy()
end)
yesbutton.MouseButton1Down:connect(function()
print("Accept")
for _,v in pairs(game:GetService("Workspace"):GetChildren()) do
if v:IsA("Sound") then
v:Destroy()
end
end
gui:Destroy()
end)
My issue is that when I use Filtering Enabled, the button stop working. This is a server script inside ServerScriptService. I'm honestly clueless about why it isn't working.

2 comments
Is there any errors in the output?
No errors