I am making a nice looking door that isn't an anchored brick that you can walk through. I am making a click door and the door's screen will quickly lower to allow a player to walk through.
Here's the script:
local gid = script.Parent.Configuration.GroupID
local ttw = script.Parent.Configuration.TimeToWait
local door = script.Parent.door
local l = script.Parent.Light
local d = false
local need = false
local ori
if gid.Value == 0 then
need = false
else
need = true
end
function open(p)
if d == false then d = true else return end
if need == true and p:IsInGroup(gid.Value) or need == false then
l.BrickColor = BrickColor.new("Toothpaste")
for i = door.CFrame.Y, door.CFrame.Y-door.Size.Y+0.2, -0.1 do
door.CFrame = CFrame.new(Vector3.new(door.Position.X, i, door.Position.Z))
wait(-1)
end
wait(ttw.Value)
for i = door.CFrame.Y, door.CFrame.Y+door.Size.Y+0.2, 0.1 do
door.CFrame = CFrame.new(Vector3.new(door.Position.X, i, door.Position.Z))
wait(-1)
end
l.BrickColor = BrickColor.new("New Yeller")
else
Error()
end
d = false
end
function Error()
l.BrickColor = BrickColor.new("Really red")
wait(.5)
l.BrickColor = BrickColor.new("New Yeller")
wait(.5)
l.BrickColor = BrickColor.new("Really red")
wait(.5)
l.BrickColor = BrickColor.new("New Yeller")
wait(.5)
l.BrickColor = BrickColor.new("New Yeller")
end
script.Parent.door.ClickDetector.MouseClick:connect(function(C)
if C ~= nil then
open(C)
end
end)
I don't get anything in the output and the door lowers SLOWLY not quickly. I don't want people to hate my game just because the doors are incredibly slow.
Here is a graph of the door (with labels)
I don't know how to fix this and I hope someone can help me.

1 comment
Thx! It worked!