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

Is there a ignore list for .Touched function?

I'm trying to ignore multiple parts that are in a table in a .Touched function

local ignore = {}
touchevent = workspace.Part.Touched:connect(function(touched)
				 if touched ~= ignore then
					print("aaa")
				end
			end)

1 answer

✓ Accepted answer

You would check if the part is a descendant of the things on the ignore list.

local ignore = {}

workspace.Part.Touched:Connect(function(hit)
	for _,v in pairs(ignore)do
		if hit:IsDescendantOf(v) then return end
	end

	-- code

end)

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