I have a keycard door script that I put inside a part and when a tool called masterkey a tool called dungeonkey touches it it turns cancollide off, but the door opens when you touch it without it
script.Parent.Touched:connect(function(p)
if p.Parent.Name == "MasterKey" or "DungeonKey" then --
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
wait(1)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end
end)
Be aware that the single key version of this script works, aka
script.Parent.Touched:connect(function(p)
if p.Parent.Name == "MasterKey" then --
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
wait(1)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end
end)
Works perfectly with FE on

1 comment
You have to compare the name with both. You're telling the script "is the name equal to 'MasterKey', or is 'DungeonKey' valid?" To fix this, just simply do like what you did with "MasterKey". :)