Allow multiple players from table to access item

How would I change this script to allow all players in the names table to receive the accessory?

local name = "WindingTheRopes"
local names = {"name", "name"}
if script.Parent.Parent.Name == name then
    -- put code here if you want
else
    script.Parent:Destroy()
end

Use table.find.

if table.find(names, script.Parent.Parent.Name) then
    -- stuff
end
1 Like