Guest User

What is wrong with this script?

a guest
Jul 14th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. LDoor = script.Parent.Parent.LDoor
  2. RDoor = script.Parent.Parent.RDoor
  3.  
  4. function onTouched(touch)
  5. if debounce == true then
  6.     debounce = false
  7.     for i=1, 8 do
  8.         LDoor.CFrame = CFrame.new(LDoor.CFrame.x + 0.8,LDoor.CFrame.y,LDoor.CFrame.z)
  9.         RDoor.CFrame = CFrame.new(RDoor.CFrame.x - 0.8,RDoor.Cframe.y,RDoor.CFrame.z)
  10.     end
  11. wait(1)
  12. for i=1,8 do
  13.             LDoor.CFrame = CFrame.new(LDoor.CFrame.x - 0.8,LDoor.CFrame.y,LDoor.CFrame.z)
  14.         RDoor.CFrame = CFrame.new(RDoor.CFrame.x + 0.8,RDoor.Cframe.y,RDoor.CFrame.z)
  15.     wait()
  16. end
  17. debounce = true
  18. end
  19. end
  20.  
  21. script.Parent.Touched:connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment