Code:
allowed = {"Guest","Aroblix",""} --Who is allowed through the door?
opentime = 1 --How much time will the door be open?
transparency = 0.5 --How transparent is the door when open?
function check(playername)
for count,name in pairs(allowed) do
if (string.lower(playername) == string.lower(name)) then
return true
end
end
return false
end
function open(part)
if part.Parent:isA('Character') then
if check(part.Parent.Name) then
script.Parent.Collidable = false
script.Parent.Transparency = transparency
sleep(opentime)
script.Parent.Collidable = true
script.Parent.Transparency = 0
end
end
end
link(script.Parent.Collided, open)
--Coded by Aroblix.