So, i have a table with some string values:
table = {"Part","Brick","Something"}
And i have script which destroys anything it touches:
function destroy(WhoTouched)
WhoTouched:Destroy()
end
script.Parent.Touched:connect(destroy)
But i need to check the name of the brick, and if name in the table, do not destroy that part:
for index,value in pairs(table) do
if WhoTouched.Name ~= value then
WhoTouched:Destroy()
end
end
The problem is - if table contains more than one value, script destroys everything, even parts with names in the table. So how exactly do i check name?
