xmaanzach

ClickAble Door Script

Jan 1st, 2018
1,537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. local Wood = true
  2.  
  3. local Parent = script.Parent
  4.  
  5. local function on()
  6. Wood = true
  7. Parent.Transparency = 0
  8. Parent.CanCollide = true
  9. end
  10.  
  11. local function off()
  12. Wood = false
  13. Parent.Transparency = 0.8
  14. Parent.CanCollide = false
  15. end
  16.  
  17. local function OnClicked()
  18. if Wood == true then off() else on() end
  19. end
  20.  
  21. Parent.ClickDetector.MouseClick:connect(OnClicked)
  22. on()
Advertisement
Add Comment
Please, Sign In to add comment