Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --<tkcmdr>--
- local door = script.Parent
- local bool = true
- local bool2 = true
- local clearance = {
- ["Command"] = true,
- ["Alpha"] = true,
- ["Beta"] = true,
- ["Charlie"] = true,
- ["Delta"] = true,
- ["Echo"] = true,
- ["Fox"] = true,
- ["Golf"] = false,
- ["T-Card"] = false
- }
- function openDoor()
- script.Parent.DoorOpen:play()
- for i = 1,(door.Size.z / 0.30) do
- door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.55)
- wait()
- end
- door.Transparency = 1
- for i,v in pairs(door:GetChildren()) do
- if v:IsA("Decal") then
- v.Transparency = 1
- end
- end
- wait(3)
- door.Transparency = 0
- for i,v in pairs(door:GetChildren()) do
- if v:IsA("Decal") then
- v.Transparency = 0
- end
- end
- script.Parent.DoorClose:play()
- for i = 1,(door.Size.z / 0.30) do
- wait()
- door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.55)
- end
- end
- script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
- if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
- bool = false
- script.Parent.AccessGranted:play()
- script.Parent.Parent.Light1.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light2.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light3.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light4.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light5.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light6.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light7.brickColor = BrickColor.new("Lime green")
- openDoor()
- wait(1)
- script.Parent.Parent.Light1.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light2.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light3.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light4.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light5.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light6.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light7.brickColor = BrickColor.new("Lily white")
- bool = true
- elseif touch.Name == "Handle" and not clearance[touch.Parent.Name] and bool2 then
- bool2 = false
- script.Parent.AccessDenied:play()
- wait(1)
- bool2 = true
- end
- end)
- script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
- if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
- bool = false
- script.Parent.AccessGranted:play()
- script.Parent.Parent.Light1.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light2.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light3.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light4.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light5.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light6.brickColor = BrickColor.new("Lime green")
- script.Parent.Parent.Light7.brickColor = BrickColor.new("Lime green")
- openDoor()
- wait(1)
- script.Parent.Parent.Light1.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light2.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light3.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light4.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light5.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light6.brickColor = BrickColor.new("Lily white")
- script.Parent.Parent.Light7.brickColor = BrickColor.new("Lily white")
- bool = true
- elseif touch.Name == "Handle" and not clearance[touch.Parent.Name] and bool2 then
- bool2 = false
- script.Parent.AccessDenied:play()
- wait(1)
- bool2 = true
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement