RoScripter

Elevator Door Button Script

Jun 26th, 2020
1,785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local Capsule = script.Parent.Parent
  2. local LeftDoor = Capsule.LeftDoor
  3. local RightDoor = Capsule.RightDoor
  4. local ClickDetector = script.Parent.ClickDetector
  5.  
  6.  
  7. ClickDetector.MouseClick:Connect(function()
  8.     if LeftDoor.CanCollide == true then
  9.         LeftDoor.CanCollide = false
  10.         RightDoor.CanCollide = false
  11.         LeftDoor.Transparency = 1
  12.         RightDoor.Transparency = 1
  13.     else
  14.         LeftDoor.CanCollide = true
  15.         RightDoor.CanCollide = true
  16.         LeftDoor.Transparency = 0
  17.         RightDoor.Transparency = 0
  18.     end
  19. end)
Add Comment
Please, Sign In to add comment