Advertisement
KnightZoro

Bridge tol

Aug 4th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. me = game.Players.Zororion
  2.  
  3. if script.Parent.className ~= "HopperBin" then
  4. h = Instance.new("HopperBin")
  5. h.Parent = me.Backpack
  6. h.Name = "lolwut"
  7. script.Parent = h
  8. end
  9.  
  10. sp = script.Parent
  11.  
  12. bridges = {}
  13.  
  14.  
  15. hold = false
  16. using = false
  17. holdkey = false
  18.  
  19. polesize = 5
  20.  
  21. function selected(mouse, key)
  22. mouse.Button1Down:connect(function()
  23. if mouse.Target == nil then return end
  24. if using == true then return end
  25. using = true
  26. hold = true
  27. pos = mouse.Hit.p
  28. p = Instance.new("Part")
  29. p.Parent = workspace
  30. p.formFactor = 0
  31. p.Size = Vector3.new(5,1,1)
  32. p.Anchored = true
  33. p.Transparency = 0.6
  34. p.TopSurface = 0
  35. p.BrickColor = BrickColor.new("Brown")
  36. p.BottomSurface = 0
  37. p.CFrame = CFrame.new(pos)
  38. mes = Instance.new("SpecialMesh")
  39. mes.Parent = p
  40. mes.MeshType = "Brick"
  41. mes.Scale = Vector3.new(1,1,1)
  42. table.insert(bridges, p)
  43. mouse.Move:connect(function()
  44. if mouse.Target == nil then return end
  45. if hold == true then
  46. local dist = (p.Position - mouse.Hit.p).magnitude
  47. p.CFrame = CFrame.new((mouse.Hit.p + pos)/2, pos)
  48. mes.Scale = Vector3.new(1,1,dist*2)
  49. end
  50. end)
  51. end)
  52. mouse.Button1Up:connect(function()
  53. hold = false
  54. local duh = p.CFrame
  55. p.Size = Vector3.new(5,1,mes.Scale.Z)
  56. p.CFrame = duh
  57. mes:remove()
  58. for i=1, 5 do
  59. wait()
  60. p.Transparency = p.Transparency - 0.12
  61. end
  62. p.Material = "Wood"
  63. using = false
  64. end)
  65. mouse.KeyDown:connect(function(key)
  66. key = key:lower()
  67. if (key == "r") then
  68. for i=1, #bridges do
  69. bridges[i]:remove()
  70. end
  71. elseif (key == "q") then
  72. polesize = polesize - 1
  73. local ms = Instance.new("Message")
  74. ms.Parent = me
  75. ms.Text = "Pole size decreased to "..polesize
  76. wait(0.4)
  77. ms:remove()
  78. elseif (key == "e") then
  79. polesize = polesize + 1
  80. local ms = Instance.new("Message")
  81. ms.Parent = me
  82. ms.Text = "Pole size increased to "..polesize
  83. wait(0.4)
  84. ms:remove()
  85. elseif (key == "f") then
  86. if mouse.Target == nil then return end
  87. if using == true then return end
  88. using = true
  89. holdkey = true
  90. po = Instance.new("Part")
  91. po.Parent = workspace
  92. po.formFactor = 0
  93. po.Size = Vector3.new(1,1,1)
  94. po.Anchored = true
  95. po.Transparency = 0.5
  96. po.TopSurface = 0
  97. po.BrickColor = BrickColor.new("Brown")
  98. po.BottomSurface = 0
  99. mesh = Instance.new("SpecialMesh")
  100. mesh.Parent = po
  101. mesh.Scale = Vector3.new(1,polesize,1)
  102. po.CFrame = CFrame.new(mouse.Hit.p.X, mouse.Hit.p.Y + mesh.Scale.Y/2, mouse.Hit.p.Z)
  103. table.insert(bridges,po)
  104. end
  105. end)
  106. mouse.KeyUp:connect(function(key)
  107. key = key:lower()
  108. if (key == "f") then
  109. holdkey = false
  110. for i=1, 5 do
  111. wait()
  112. po.Transparency = po.Transparency - 0.1
  113. end
  114. local posi = po.CFrame
  115. po.Material = "Wood"
  116. po.Size = mesh.Scale
  117. mesh:remove()
  118. po.CFrame = posi
  119. using = false
  120. end
  121. end)
  122. end
  123.  
  124. function deselected()
  125. end
  126.  
  127. sp.Selected:connect(selected)
  128. sp.Deselected:connect(deselected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement