Something like this if you want to ignore all players:
local Part = script.Parent
Part.Touched:connect(function(hit)
if not hit.Parent:FindFirstChild("Humanoid") then
print("Not a player")
else
end
end)
If you want it to ignore certain parts then
You can just iterate through all the ignoreParts, and check if it should be ignored or not.
Something like this:
local Part = script.Parent
local ignoreTable = {"Part1", "Part2", "Part3"}
local function shouldIgnore(part)
local ignoreable = false
for _, v in pairs(ignoreTable) do
if v == part.Name then
ignoreable = true
end
end
return ignoreable
end
Part.Touched:connect(function(hit)
if shouldIgnore(hit) then
print("Not in ignore list")
else
end
end)
Those are two ways of doing them, you get the idea, you can replace the names with objects of actual parts instead if you want.
Hope I helped, please let me know if you have any questions!