local debounce = true
script.Parent.Touched:connect(function(Part)
if debounce == true then
debounce = false
local Staff = Part.BoolValue.Value
if Part.Name == "Handle" and Staff == false then
if Part.CardNumber.Value == script.Parent.RoomNumber.Value then
script.Parent.Parent.Door.CanCollide = false
script.Parent.Parent.Door.Transparency = 0.4
wait(2)
script.Parent.Parent.Door.CanCollide = true
script.Parent.Parent.Door.Transparency = 0
elseif Part.Name == "Handle" and Staff == true then
script.Parent.Parent.Door.CanCollide = false
script.Parent.Parent.Door.Transparency = 0.4
wait(2)
script.Parent.Parent.Door.CanCollide = true
script.Parent.Parent.Door.Transparency = 0
end
end
if debounce == false then
debounce = true
end
wait(0.2)
end
end)
For some reason the touched function and BoolValue aren't working. But everything is there. How do I fix this? Help is greatly appreciated...
