TheUnknownDiscord

Untitled

Mar 15th, 2022 (edited)
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 KB | None | 0 0
  1. local rayblacklist = {}
  2. local partta = {}
  3. local sizes = {}
  4. local sound = Instance.new("Sound")
  5. sound.Volume = 1
  6. sound.SoundId = "rbxassetid://6988979548"
  7. sound.PlayOnRemove = true
  8. tool = Instance.new("Tool",owner.Character)
  9. part = Instance.new("Part",tool)
  10. part.Name = "Handle"
  11. local texture = Instance.new("Texture",part)
  12. texture.Face = "Front"
  13. texture.StudsPerTileU=2
  14. texture.StudsPerTileV=1
  15. texture.OffsetStudsU=0
  16. texture.Texture = "rbxassetid://9110401157"
  17. part.Size = Vector3.new(1,1,1)
  18. part2 = Instance.new("Part",part)
  19. part2.Size = Vector3.new(1,0.25,0.25)
  20. tank = Instance.new("Part",owner.Character)
  21. tank.Size = Vector3.new(1,0.125,1)
  22. tank2 = Instance.new("Part",owner.Character)
  23. tank2.Size = Vector3.new(1.25,0.125,1.25)
  24. tank3 = Instance.new("Part",owner.Character)
  25. tank3.Size = Vector3.new(1.25,0.125,1.25)
  26. tank4 = Instance.new("Part",owner.Character)
  27. tank4.Size = Vector3.new(1.125,1.5,1.125)
  28. tank4.Transparency = 0.65
  29. tank.Material = "Sand"
  30. tank2.Material = "SmoothPlastic"
  31. tank3.Material = "SmoothPlastic"
  32. tank4.Material = "SmoothPlastic"
  33. local weld = Instance.new("Weld",part)
  34. weld.Part0 = part2
  35. weld.Part1 = part
  36. weld.C0 = CFrame.new(-1,-0.25,0)
  37. local weld2 = Instance.new("Weld",owner.Character.Torso)
  38. weld2.Part0 = tank
  39. weld2.Part1 = owner.Character.Torso
  40. weld2.C0 = CFrame.new(0,0.45,-1.125)
  41. local weld3 = Instance.new("Weld",owner.Character.Torso)
  42. weld3.Part0 = tank2
  43. weld3.Part1 = owner.Character.Torso
  44. weld3.C0 = CFrame.new(0,-1,-1.125)
  45. local weld4 = Instance.new("Weld",owner.Character.Torso)
  46. weld4.Part0 = tank3
  47. weld4.Part1 = owner.Character.Torso
  48. weld4.C0 = CFrame.new(0,0.5,-1.125)
  49. local weld5 = Instance.new("Weld",owner.Character.Torso)
  50. weld5.Part0 = tank4
  51. weld5.Part1 = owner.Character.Torso
  52. weld5.C0 = CFrame.new(0,-0.25,-1.125)
  53. tool.Grip = CFrame.new(1.25,0,0)
  54. local on = false
  55. ammotake = false
  56. tool.Activated:Connect(function()
  57. on = true
  58. delay(0.25,function()
  59. if on then
  60. ammotake = true
  61. else
  62. if partta[#partta] then
  63. if partta[#partta - 1] then
  64. tank.Color = partta[#partta - 1].Color
  65. end
  66. local tweenService = game:GetService("TweenService")
  67. local timeToFade = 0.0625
  68. local object = tank
  69. local tweenInfo = TweenInfo.new(timeToFade)
  70. local goal = {}
  71. goal.Size = Vector3.new(1,object.Size.Y - 0.025,1)
  72. local tween = tweenService:Create(object, tweenInfo, goal)
  73. tween:Play()
  74. local timeToFade = 0.0625
  75. local object = weld2
  76. local tweenInfo = TweenInfo.new(timeToFade)
  77. local goal = {}
  78. goal.C0 = object.C0 * CFrame.new(0,0.015,0)
  79. local tween = tweenService:Create(object, tweenInfo, goal)
  80. tween:Play()
  81. texture.OffsetStudsU=1
  82. local donthit = {}
  83. partta[#partta].Parent = script
  84. partta[#partta].CFrame = part.CFrame
  85. partta[#partta].Anchored = false
  86. game:GetService("Debris"):AddItem(partta[#partta],20)
  87. table.insert(rayblacklist,partta[#partta])
  88. local tweenService = game:GetService("TweenService")
  89. local timeToFade = 0.0625
  90. local object = partta[#partta]
  91. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  92. local goal = {}
  93. goal.CFrame = part.CFrame * CFrame.new(0,partta[#partta].Size.Y,-partta[#partta].Size.Z + -10)
  94. goal.Size = sizes[#partta]
  95. goal.Transparency = 0
  96. local tween = tweenService:Create(object, tweenInfo, goal)
  97. tween:Play()
  98. local cf = part.CFrame
  99. local v = partta[#partta]
  100. v.CanTouch = false
  101. coroutine.wrap(function()
  102. tween.Completed:Wait()
  103. texture.OffsetStudsU=0
  104. v:ApplyImpulse(cf.LookVector * v:GetMass() * 250 + Vector3.new(0,v:GetMass() * workspace.Gravity * 0.25,0))
  105. v.CanTouch = true
  106. v.CanCollide = true
  107. local hitplayers = {}
  108. partta[#partta].Touched:Connect(function(hit)
  109. local hum = hit.Parent:FindFirstChildWhichIsA("Humanoid") or hit.Parent.Parent:FindFirstChildWhichIsA("Humanoid")
  110. if hum and not table.find(hitplayers,hum) then
  111. table.insert(hitplayers,hum)
  112. hum.Health -= 5 * v.Size.Magnitude
  113. end
  114. end)
  115. end)()
  116. sizes[#partta] = nil
  117. partta[#partta] = nil
  118. end
  119. end
  120. end)
  121. end)
  122. tool.Deactivated:Connect(function()
  123. on = false
  124. ammotake = false
  125. texture.OffsetStudsU=0
  126. end)
  127. coroutine.wrap(function()
  128. while wait(0.0325) do
  129. if on and not ammotake then
  130. texture.OffsetStudsU=1
  131. sound.Parent = part
  132. sound.PlaybackSpeed = 1
  133. sound.SoundId = "rbxassetid://6717089252"
  134. sound.Parent = nil
  135. for i = 1, 9 do
  136. wait(0.0125)
  137. local bul = Instance.new("SpawnLocation",script)
  138. bul.Enabled = false
  139. game:GetService("Debris"):AddItem(bul,0.125)
  140. bul.Anchored = true
  141. table.insert(rayblacklist,bul)
  142. bul.CFrame = part.CFrame * CFrame.new(Random.new():NextNumber(-1,1),Random.new():NextNumber(-1,1),-1)
  143. local x,y,z = CFrame.new(part.Position,bul.Position):ToEulerAnglesXYZ()
  144. bul.CFrame = CFrame.new(bul.Position) * CFrame.Angles(x,y,z)
  145. bul.Size = Vector3.new(0.1,0.1,0.5)
  146. bul.CanCollide = false
  147. bul.Material = "Neon"
  148. bul.Transparency = 0.125
  149. local tweenService = game:GetService("TweenService")
  150. local timeToFade = 0.125
  151. local object = bul
  152. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  153. local goal = {}
  154. goal.CFrame = bul.CFrame * CFrame.new(0,0,math.random(-12,-8))
  155. goal.Size = Vector3.new(0.05,0.05,1)
  156. goal.Transparency = 1
  157. local tween = tweenService:Create(object, tweenInfo, goal)
  158. tween:Play()
  159. end
  160. elseif on and ammotake then
  161. sound.Parent = part
  162. sound.PlaybackSpeed = 1.5
  163. sound.SoundId = "rbxassetid://6988979548"
  164. sound.Parent = nil
  165. texture.OffsetStudsU=1
  166. local bul = Instance.new("SpawnLocation",script)
  167. bul.Enabled = false
  168. game:GetService("Debris"):AddItem(bul,0.125)
  169. bul.Anchored = true
  170. table.insert(rayblacklist,bul)
  171. bul.CFrame = part.CFrame * CFrame.new(Random.new():NextNumber(-1,1),Random.new():NextNumber(-1,1),-1)
  172. local x,y,z = CFrame.new(part.Position,bul.Position):ToEulerAnglesXYZ()
  173. bul.CFrame = CFrame.new(bul.Position) * CFrame.Angles(x,y,z) * CFrame.new(0,0,math.random(-12,-8))
  174. bul.Size = Vector3.new(0.1,0.1,0.5)
  175. bul.CanCollide = false
  176. bul.Material = "Neon"
  177. bul.Transparency = 1
  178. local tweenService = game:GetService("TweenService")
  179. local timeToFade = 0.125
  180. local object = bul
  181. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  182. local goal = {}
  183. goal.CFrame = bul.CFrame * CFrame.new(0,0,(part.Position - bul.Position).Magnitude)
  184. goal.Size = Vector3.new(0.05,0.05,1)
  185. goal.Transparency = 0.125
  186. local tween = tweenService:Create(object, tweenInfo, goal)
  187. tween:Play()
  188. end
  189. end
  190. end)()
  191. while task.wait() do
  192. if ammotake then
  193. ang = CFrame.Angles(0,0,math.pi * 2 * math.random()) * CFrame.Angles(math.random() * math.rad(30),0,0)
  194. dir = part.Position
  195. dir = (CFrame.new(dir,part.Position + part.CFrame.lookVector * 20) * ang).lookVector
  196. local params = RaycastParams.new()
  197. params.FilterDescendantsInstances = {rayblacklist}
  198. params.FilterType = Enum.RaycastFilterType.Blacklist
  199. local result = workspace:Raycast(part.Position, dir * 10, params)
  200. if result and not table.find(partta,result.Instance) and result.Instance.Name ~= "Base" and #partta < 50 then
  201. local what = result.Instance
  202. if what.Size.X < 25 then
  203. if what.Size.Y < 25 then
  204. if what.Size.Z < 25 then
  205. table.insert(partta,result.Instance)
  206. result.Instance.CanCollide = false
  207. result.Instance.Anchored = true
  208. table.insert(sizes,result.Instance.Size)
  209. local tweenService = game:GetService("TweenService")
  210. local timeToFade = 0.0625
  211. local object = tank
  212. local tweenInfo = TweenInfo.new(timeToFade)
  213. local goal = {}
  214. goal.Size = Vector3.new(1,object.Size.Y + 0.025,1)
  215. local tween = tweenService:Create(object, tweenInfo, goal)
  216. tween:Play()
  217. tank.Color = what.Color
  218. local tweenService = game:GetService("TweenService")
  219. local timeToFade = 0.0625
  220. local object = weld2
  221. local tweenInfo = TweenInfo.new(timeToFade)
  222. local goal = {}
  223. goal.C0 = object.C0 * CFrame.new(0,-0.015,0)
  224. local tween = tweenService:Create(object, tweenInfo, goal)
  225. tween:Play()
  226. what:BreakJoints()
  227. local tweenService = game:GetService("TweenService")
  228. local timeToFade = 0.125
  229. local object = result.Instance
  230. local tweenInfo = TweenInfo.new(timeToFade)
  231. local goal = {}
  232. goal.CFrame = part.CFrame
  233. goal.Size = result.Instance.Size * 0.25
  234. goal.Transparency = 1
  235. local tween = tweenService:Create(object, tweenInfo, goal)
  236. tween:Play()
  237. tween.Completed:Wait()
  238. result.Instance.Parent = nil
  239. end
  240. end
  241. end
  242. end
  243. end
  244. end
Add Comment
Please, Sign In to add comment