How do you destroy all sounds with a script in game?

Hello, not sure this is the right category but my game gets constantly exploited by people playing server wide music and loud sounds.

Is there a script I can run that destroys all sounds using the :script command in Adonis Admin whilst in game?

Let me know if you need any more detail. Thanks! :slight_smile:

I donโ€™t know about your admin system, but if exploiters can access the server you have a serious problem and should focus on fixing that. Deleting sounds they insert is just an indirect solution. But you could loop through all the children of the workspace and use :IsA(โ€œSoundโ€) and then delete those sounds.

2 Likes
local c = 0
for _, d in ipairs(workspace:GetDescendants() do
	if (d:IsA("Sound")) then
		d:Stop()
		d:Destroy()
		c = c + 1
	end
end
warn(c.." sounds removed")

Formatted for a one-line admin/dev console command:

local c = 0 for _, d in ipairs(workspace:GetDescendants() do if d:IsA("Sound") then d:Stop() d:Destroy() c = c+1 end end warn(c.." sounds removed")

Also if you have exploiters doing stuff on the server you might have a backdoor problem.

5 Likes