Advertisement
Drewiscool123

ac130

Jul 26th, 2018
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. local players = game:GetService("Players")
  2. local workspace = game:GetService("Workspace")
  3. local me = players.drew11pogi
  4. local name = me.Name
  5. local char = me.Character
  6. local pg = me.PlayerGui
  7. local move = false
  8. local mach = false
  9.  
  10. pcall(function() workspace.Base.AC130:remove() end)
  11. local model = Instance.new("Model", workspace.Base)
  12. model.Name = "AC130"
  13.  
  14. local base = Instance.new("Part", model)
  15. base.Size = Vector3.new(15, 10, 30)
  16. base.BrickColor = BrickColor.new("Mid stone grey")
  17. base.Anchored = false
  18. base.CFrame = CFrame.new(25, 16, 0)
  19. base:BreakJoints()
  20. local basep = Instance.new("BodyPosition", base)
  21. basep.position = Vector3.new(0, 25, 0)
  22. basep.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  23. local basem = Instance.new("SpecialMesh", base)
  24. basem.MeshType = "Sphere"
  25. local base2 = Instance.new("Part", model)
  26. base2.Size = Vector3.new(30, 2, 8)
  27. base2.BrickColor = BrickColor.new("Mid stone grey")
  28. base2.Anchored = false
  29. base2.CFrame = CFrame.new(25, 20, 0)
  30. base2:BreakJoints()
  31. local base2m = Instance.new("BlockMesh", base2)
  32. local base2w = Instance.new("Weld", base2)
  33. base2w.Part0 = base2
  34. base2w.Part1 = base
  35. base2w.C1 = CFrame.new(0, 0, 0)
  36.  
  37. if script.Parent.className ~= "HopperBin" then
  38. local h = Instance.new("HopperBin", me.Backpack)
  39. h.Name = "AC-130"
  40. script.Parent = h
  41. end
  42.  
  43. local bin = script.Parent
  44.  
  45. function onSelected(mouse)
  46. mouse.Button1Down:connect(function()
  47. if move == false then
  48. move = true
  49. coroutine.resume(coroutine.create(function()
  50. while wait() do
  51. if move == true then
  52. basep.position = mouse.hit.p + Vector3.new(0, 25, 0)
  53. else
  54. break
  55. end
  56. end
  57. end))
  58. end
  59. end)
  60. mouse.Button1Up:connect(function()
  61. move = false
  62. end)
  63. mouse.KeyDown:connect(function(key)
  64. if key == "q" then
  65. if mach == false then
  66. mach = true
  67. pos = mouse.hit.p + Vector3.new(math.random(-1.5, 1.5), 0, math.random(-1.5, 1.5))
  68. pos2 = base.Position
  69. local shot = Instance.new("Part", workspace)
  70. shot.formFactor = "Custom"
  71. shot.BrickColor = BrickColor.new("New Yeller")
  72. shot.Size = Vector3.new(0.2, 0.2, (pos - pos2).magnitude)
  73. shot.Anchored = true
  74. shot.CanCollide = false
  75. shot.CFrame = CFrame.new((pos + pos2)/2, pos)
  76. coroutine.resume(coroutine.create(function()
  77. wait(0.15)
  78. shot:remove()
  79. end))
  80. coroutine.resume(coroutine.create(function()
  81. while wait() do
  82. if mach == true then
  83. pos = mouse.hit.p + Vector3.new(math.random(-1.5, 1.5), 0, math.random(-1.5, 1.5))
  84. pos2 = base.Position
  85. local shot = Instance.new("Part", workspace)
  86. shot.formFactor = "Custom"
  87. shot.BrickColor = BrickColor.new("New Yeller")
  88. shot.Size = Vector3.new(0.2, 0.2, (pos - pos2).magnitude)
  89. shot.Anchored = true
  90. shot.CanCollide = false
  91. shot.CFrame = CFrame.new((pos + pos2)/2, pos)
  92. coroutine.resume(coroutine.create(function()
  93. wait(0.15)
  94. shot:remove()
  95. end))
  96. else
  97. break
  98. end
  99. end
  100. end))
  101. end
  102. end
  103. if key == "e" then
  104. if bom == false then
  105. bom = true
  106. pos = mouse.hit.p + Vector3.new(math.random(-1.5, 1.5), 0, math.random(-1.5, 1.5))
  107. pos2 = base.Position
  108. local shot = Instance.new("Part", workspace)
  109. shot.formFactor = "Custom"
  110. shot.BrickColor = BrickColor.new("New Yeller")
  111. shot.Size = Vector3.new(0.2, 0.2, (pos - pos2).magnitude)
  112. shot.Anchored = true
  113. shot.CanCollide = false
  114. shot.CFrame = CFrame.new((pos + pos2)/2, pos)
  115. local ex = Instance.new("Explosion", workspace)
  116. ex.Position = pos
  117. ex.BlastRadius = 2.5
  118. coroutine.resume(coroutine.create(function()
  119. wait(0.15)
  120. shot:remove()
  121. end))
  122. coroutine.resume(coroutine.create(function()
  123. while wait() do
  124. if bom == true then
  125. pos = mouse.hit.p + Vector3.new(math.random(-1.5, 1.5), 0, math.random(-1.5, 1.5))
  126. pos2 = base.Position
  127. local shot = Instance.new("Part", workspace)
  128. shot.formFactor = "Custom"
  129. shot.BrickColor = BrickColor.new("New Yeller")
  130. shot.Size = Vector3.new(0.2, 0.2, (pos - pos2).magnitude)
  131. shot.Anchored = true
  132. shot.CanCollide = false
  133. shot.CFrame = CFrame.new((pos + pos2)/2, pos)
  134. local ex = Instance.new("Explosion", workspace)
  135. ex.Position = pos
  136. ex.BlastRadius = 2.5
  137. coroutine.resume(coroutine.create(function()
  138. wait(0.15)
  139. shot:remove()
  140. end))
  141. else
  142. break
  143. end
  144. end
  145. end))
  146. end
  147. end
  148. end)
  149. mouse.KeyUp:connect(function(key)
  150. if key == "q" then
  151. mach = false
  152. end
  153. if key == "e" then
  154. bom = false
  155. end
  156. end)
  157. end
  158.  
  159. function onDesel(mouse)
  160. end
  161.  
  162. bin.Selected:connect(onSelected)
  163. bin.Deselected:connect(onDesel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement