Advertisement
lafur

Untitled

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