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

I need help with a script?

I'm sorry I know this site isn't for request but I have no idea how to even start this script other than using while wait(0.1) do anyways... I need a script that will go into every single child in the workspace and if the child has more children then go into those also and delete an item from them like OH SNAP YOU GOT INFECTED XD XD XD from the children in the workspace would anyone mind helping me out yes I know again this site isn't for request but i'm desperate....

1 answer

You could use a recursive function.

local remove = {} 

local function shouldRemove(name)
	for i2, v2 in next, remove do
		if tostring(i2):lower() == name:lower() or tostring(v2):lower() == name:lower() then
			return true
		end
	end
	return false
end

local function scan(v)
	for i,v in next, v:GetChildren() do
		if shouldRemove(v.Name) then
			v:Destroy()
		end
		scan(v)
	end
end

scan(Workspace)

Make sure you put the names of things you want removed in the remove table on line 1.

1 comment

0

Thank you so much it worked :D I made roblox anti-virus :D

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