Advertisement
HowToRoblox

ClickScriptB

Oct 2nd, 2019
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local ButtonPress = script.Parent:WaitForChild("ClickDetector")
  2. local Door = game.Workspace.DoorB.door
  3. local lol = false
  4. local Xscale = Door.Size.X
  5.  
  6. ButtonPress.MouseClick:Connect(function(touch)
  7.     if lol == false then
  8.         for x = 1,5 do
  9.             for i = 1, Xscale do
  10.                 Door.Size = Vector3.new(Door.Size.X - 0.2, Door.Size.Y, Door.Size.Z)
  11.                 Door.CFrame = Door.CFrame*CFrame.new(0.1, 0, 0)
  12.                 wait()
  13.                 lol = true
  14.             end
  15.         end
  16.     end
  17. end)
  18.    
  19. ButtonPress.MouseClick:Connect(function(touch)
  20.     if lol == true then
  21.         for x = 1,5 do
  22.             for i = 1, Xscale do
  23.                 Door.Size = Vector3.new(Door.Size.X + 0.2, Door.Size.Y, Door.Size.Z)
  24.                 Door.CFrame = Door.CFrame*CFrame.new(-0.1, 0, 0)
  25.                 wait()
  26.                 lol = false
  27.             end
  28.         end
  29.     end
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement