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

12: missing argument #2 to 'find' (string expected)?

local banned = {"anti-lag", "OS.C-REX", "vaccine", "4d being", "c-rex", "nom", "game destroyer", "firespread", "rofl", "c6ouqz", "9vssb36tj", "wildfire", "antivirus"}

local dec = game:GetDescendants()
local obje
local isit

while true do
	wait()
	for _,v in ipairs(banned) do
		for _,a in ipairs(dec) do
			wait()
			isit = v:lower()
			obje = a.Name:lower()
			if obje.find(isit) then
				print("Object: " .. a.Name .. " found, quarantining to lighting.")
				a.Parent = game.Lighting
				wait()
				print("Object " .. a.Name .. " destroyed.")
				a:Destroy()
			end
		end
	end
end

Why am i getting the error 12: missing argument #2 to 'find' (string expected)? All help is appreciated!

1 answer

✓ Accepted answer

Do if string.find(obje,isit) then instead on line 12

or do : instead of . if obje:find(isit) then

4 comments

0

now i'm getting the error: The current identity (2) cannot Class security check (lacking permission 6)

0

still, i think it's just the fact that im searching all objects including locked objects

0

you are looping of the services of game too not all services are loading in yet and thats when you get that error

0

or you are trying to access a service thats not allowed by roblox

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