What a coincidence, I made one earlier today!
Here you go:
---------------------------------------------------------
Door = script.Parent
function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
local hat = hit.Parent:findFirstChild("EmeraldEye") -- change this to the hat you want
if (hat ~= nil) then
Door.Transparency = .5
Door.CanCollide = false
wait(3)
Door.CanCollide = true
Door.Transparency = 0
else human.Health= 0
end
end
end
connection = Door.Touched:connect(onTouched)
---------------------------------------------------------
|