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
Hey Fennict,
if "DungeonKey" then print("X"); end
if true then print("X"); end
script.Parent.Touched:Connect(function(p) if p.Parent.Name == "MasterKey" or p.Parent.Name == "DungeonKey" then script.Parent.Transparency = 0.5 script.Parent.CanCollide = false wait(1) script.Parent.Transparency = 0 script.Parent.CanCollide = true end end)