TheUnknownDiscord

good shotgun

Apr 17th, 2022 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.61 KB | None | 0 0
  1. rayblacklist = {}
  2. tool = Instance.new("Tool",owner.Backpack)
  3. local shot = Instance.new("Sound")
  4. shot.SoundId = "rbxassetid://6839481031"
  5. shot.PlayOnRemove = true
  6. shot.TimePosition = 0.2
  7. shot.Volume = 2
  8. tool.Grip = CFrame.new(0,-0.5,-1.25) * CFrame.Angles(0,math.rad(190),0)
  9. local part = Instance.new("Part",script)
  10. part.Size = Vector3.new(0.25,1,7)
  11. part.Anchored = true
  12. part.CFrame = owner.Character.Head.CFrame * CFrame.new(5,0,0)
  13. mesh = Instance.new("SpecialMesh",part)
  14. mesh.TextureId = "rbxassetid://2492974190"
  15. mesh.MeshId = "rbxassetid://2492972199"
  16. mesh.Scale = Vector3.new(1,1,1)
  17. local part2 = Instance.new("Part",part)
  18. part2.Size = Vector3.new(0.25,1,3)
  19. part2.CFrame = owner.Character.Head.CFrame * CFrame.new(4.925,0.325,0.75)
  20. mesh2 = Instance.new("SpecialMesh",part2)
  21. local cf = part.CFrame:Inverse() * part2.CFrame
  22. weld = Instance.new("Weld",part)
  23. weld.Part0 = part2
  24. weld.Part1 = part
  25. weld.C1 = cf
  26. mesh2.TextureId = "rbxassetid://2492974637"
  27. mesh2.MeshId = "rbxassetid://2492972666"
  28. local sound = Instance.new("Sound",part)
  29. sound.Volume = 1
  30. sound.SoundId = "rbxassetid://5049374013"
  31. local sound2 = Instance.new("Sound",part)
  32. sound2.Volume = 1
  33. sound2.Looped = true
  34. sound2.SoundId = "rbxassetid://4993417047"
  35. local sound3 = Instance.new("Sound")
  36. sound3.Volume = 2
  37. sound3.PlayOnRemove = true
  38. local wel = Instance.new("Weld", owner.Character.Torso)
  39. wel.Part0 = owner.Character.Torso
  40. wel.Part1 = owner.Character["Right Arm"]
  41. wel.C0 = CFrame.new(1.45, 0.5, -0.85) * CFrame.Angles(math.rad(90),0,math.rad(-10))
  42. wel.Enabled = false
  43. local wel2 = Instance.new("Weld", part2)
  44. wel2.Part0 = part2
  45. wel2.Part1 = owner.Character["Left Arm"]
  46. wel2.C0 = CFrame.new(0.5, -0.5, 0) * CFrame.Angles(math.rad(85),0,math.rad(15))
  47. wel2.Enabled = false
  48. local shells = {"7836855576","7836855160","7836854786"}
  49. local insert = "4993417047"
  50. local times = 0
  51. local tweenService = game:GetService("TweenService")
  52. local timeToFade = 0.25
  53. local object = weld
  54. local object2 = wel
  55. local object3 = tool
  56. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Quint,Enum.EasingDirection.InOut)
  57. local goal = {}
  58. goal.C0 = CFrame.new(0,0,0.6)
  59. local tween = tweenService:Create(object, tweenInfo, goal)
  60. local goal2 = {}
  61. goal2.C0 = CFrame.new(0,0,0)
  62. local tween2 = tweenService:Create(object, tweenInfo, goal2)
  63. local goal3 = {}
  64. goal3.C0 = CFrame.new(1.45, 0.5, -0.55) * CFrame.Angles(math.rad(100),0,math.rad(-10))
  65. local tween3 = tweenService:Create(object2, tweenInfo, goal3)
  66. local goal4 = {}
  67. goal4.C0 = CFrame.new(1.45, 0.5, -0.85) * CFrame.Angles(math.rad(90),0,math.rad(-10))
  68. local tween4 = tweenService:Create(object2, tweenInfo, goal4)
  69. local goal5 = {}
  70. goal5.Grip = CFrame.new(0,-0.5,-1.0625) * CFrame.Angles(0,math.rad(190),0)
  71. local tween5 = tweenService:Create(object3, tweenInfo, goal5)
  72. local goal6 = {}
  73. goal6.Grip = CFrame.new(0,-0.5,-1.25) * CFrame.Angles(0,math.rad(190),0)
  74. local tween6 = tweenService:Create(object3, tweenInfo, goal6)
  75. sound2.DidLoop:Connect(function(_, timess)
  76. if timess == 5 then
  77. sound2:Stop()
  78. times = 0
  79. end
  80. end)
  81. part.Anchored = false
  82. part.Name = "Handle"
  83. part2.CanCollide = false
  84. part.Parent = tool
  85. canfire = true
  86. mesh2.Scale = Vector3.new(1,1,1)
  87. function pump()
  88. sound:Play()
  89. tween:Play()
  90. tween3:Play()
  91. tween5:Play()
  92. coroutine.wrap(function()
  93. tween3.Completed:Wait()
  94. tween4:Play()
  95. tween6:Play()
  96. end)()
  97. times += 1
  98. if times == 5 then
  99. repeat
  100. task.wait()
  101. until sound.TimePosition >= 0.25
  102. sound:Pause()
  103. sound2:Play()
  104. local magdebris3 = Instance.new("SpawnLocation",workspace)
  105. magdebris3.Enabled = false
  106. magdebris3.Shape = "Cylinder"
  107. local magdebris4 = Instance.new("SpawnLocation",workspace)
  108. magdebris4.Enabled = false
  109. magdebris4.Shape = "Cylinder"
  110. magdebris4.CanCollide = false
  111. magdebris4.Massless = true
  112. local shellweld = Instance.new("Weld",magdebris3)
  113. shellweld.Part0 = magdebris4
  114. shellweld.Part1 = magdebris3
  115. shellweld.C0 = CFrame.new(-0.15,0,0)
  116. game:GetService("Debris"):AddItem(magdebris3,10)
  117. game:GetService("Debris"):AddItem(magdebris4,10)
  118. magdebris3.Size = Vector3.new(0.35,0.125,0.125)
  119. magdebris4.Size = Vector3.new(0.075,0.15,0.15)
  120. magdebris3.Color = Color3.fromRGB(230, 37, 37)
  121. magdebris4.Color = Color3.fromRGB(237, 203, 31)
  122. magdebris3.CFrame = part2.CFrame * CFrame.new(-0.0325,0.0625,-0.475) * CFrame.Angles(0,math.rad(90),0)
  123. magdebris3.Material = "SmoothPlastic"
  124. magdebris4.Material = "SmoothPlastic"
  125. magdebris3.Reflectance = 0.1
  126. magdebris4.Reflectance = 0.1
  127. magdebris3:ApplyImpulse(part2.CFrame.RightVector * -0.015 + part2.CFrame.upVector * 0.025)
  128. coroutine.wrap(function()
  129. wait(0.125)
  130. while true do
  131. task.wait()
  132. if magdebris3.Velocity.y <= 1 and magdebris3.Velocity.y >= -1 then
  133. pcall(function()
  134. sound3.SoundId = "rbxassetid://"..shells[math.random(1,3)]
  135. sound3.Parent = magdebris3
  136. sound3.Parent = nil
  137. end)
  138. break
  139. end
  140. end
  141. end)()
  142. repeat
  143. wait()
  144. until times == 0
  145. sound:Play()
  146. repeat
  147. task.wait()
  148. until sound.TimePosition >= 0.35
  149. else
  150. local magdebris3 = Instance.new("SpawnLocation",workspace)
  151. magdebris3.Enabled = false
  152. magdebris3.Shape = "Cylinder"
  153. local magdebris4 = Instance.new("SpawnLocation",workspace)
  154. magdebris4.Enabled = false
  155. magdebris4.Shape = "Cylinder"
  156. magdebris4.CanCollide = false
  157. magdebris4.Massless = true
  158. local shellweld = Instance.new("Weld",magdebris3)
  159. shellweld.Part0 = magdebris4
  160. shellweld.Part1 = magdebris3
  161. shellweld.C0 = CFrame.new(-0.15,0,0)
  162. game:GetService("Debris"):AddItem(magdebris3,10)
  163. game:GetService("Debris"):AddItem(magdebris4,10)
  164. magdebris3.Size = Vector3.new(0.35,0.125,0.125)
  165. magdebris4.Size = Vector3.new(0.075,0.15,0.15)
  166. magdebris3.Color = Color3.fromRGB(230, 37, 37)
  167. magdebris4.Color = Color3.fromRGB(237, 203, 31)
  168. magdebris3.CFrame = part2.CFrame * CFrame.new(-0.0325,0.0625,-1.125) * CFrame.Angles(0,math.rad(90),0)
  169. magdebris3.Material = "SmoothPlastic"
  170. magdebris4.Material = "SmoothPlastic"
  171. magdebris3.Reflectance = 0.1
  172. magdebris4.Reflectance = 0.1
  173. magdebris3:ApplyImpulse(part2.CFrame.RightVector * 0.015 + part2.CFrame.upVector * 0.025)
  174. coroutine.wrap(function()
  175. wait(0.125)
  176. while true do
  177. task.wait()
  178. if magdebris3.Velocity.y <= 1 and magdebris3.Velocity.y >= -1 then
  179. pcall(function()
  180. sound3.SoundId = "rbxassetid://"..shells[math.random(1,3)]
  181. sound3.Parent = magdebris3
  182. sound3.Parent = nil
  183. end)
  184. break
  185. end
  186. end
  187. end)()
  188. repeat
  189. task.wait()
  190. until sound.TimePosition >= 0.25
  191. end
  192. tween2:Play()
  193. canfire = true
  194. end
  195. hitsomething = Instance.new("Sound", script)
  196. hitsomething.PlayOnRemove = true
  197. canfire = true
  198. toolout = false
  199. tool.Equipped:Connect(function()
  200. toolout = true
  201. wel2.Enabled = true
  202. wel.Enabled = true
  203. end)
  204. tool.Unequipped:Connect(function()
  205. toolout = false
  206. wel2.Enabled = false
  207. wel.Enabled = false
  208. end)
  209. local E = Instance.new("RemoteEvent",owner.Character)
  210. NLS([[
  211. local E = owner.Character:FindFirstChildWhichIsA("RemoteEvent")
  212. local Mouse = owner:GetMouse()
  213. function ButtonDown()
  214. if Mouse.Target ~= nil then
  215. E:FireServer(Mouse.Hit,5)
  216. end
  217. end
  218. Mouse.Button1Down:Connect(ButtonDown)
  219. ]],owner.PlayerGui)
  220. E.OnServerEvent:Connect(function(plr,hitp,damage)
  221. if toolout and canfire then
  222. canfire = false
  223. coroutine.wrap(function()
  224. pump()
  225. end)()
  226. shot.Parent = part
  227. shot.Parent = nil
  228. coroutine.wrap(function()
  229. for i = 1, 16 do
  230. task.wait()
  231. coroutine.wrap(function()
  232. ang = CFrame.Angles(0,0,math.pi * 2 * math.random()) * CFrame.Angles(math.random() * math.rad(15),0,0)
  233. dir = part.Position + part.CFrame.lookVector * -3.75 + part.CFrame.upVector * 0.25
  234. dir = (CFrame.new(dir,hitp.Position) * ang).lookVector
  235. local params = RaycastParams.new()
  236. params.FilterDescendantsInstances = {part, owner.Character,rayblacklist}
  237. params.FilterType = Enum.RaycastFilterType.Blacklist
  238. local result = game.Workspace:Raycast(part.Position + part.CFrame.lookVector * -3.75 + part.CFrame.upVector * 0.25, dir * 500,params)
  239. local bul = Instance.new("SpawnLocation",script)
  240. bul.Enabled = false
  241. bul.Anchored = true
  242. table.insert(rayblacklist,bul)
  243. local x,y,z = CFrame.new(part.Position + part.CFrame.lookVector * -3.75 + part.CFrame.upVector * 0.25,hitp.Position):ToEulerAnglesXYZ()
  244. bul.CFrame = CFrame.new(part.Position + part.CFrame.lookVector * -3.75) * CFrame.Angles(x,y,z) * ang
  245. bul.Size = Vector3.new(0.1,0.1,1)
  246. bul.CanCollide = false
  247. bul.Material = "Neon"
  248. if not result then
  249. game:GetService("Debris"):AddItem(bul,5)
  250. local tweenService = game:GetService("TweenService")
  251. local timeToFade = 5
  252. local object = bul
  253. local tweenInfo = TweenInfo.new(timeToFade)
  254. local goal = {}
  255. goal.CFrame = bul.CFrame * CFrame.new(0,0,-1000)
  256. goal.Transparency = 1
  257. local tween = tweenService:Create(object, tweenInfo, goal)
  258. tween:Play()
  259. elseif result then
  260. game:GetService("Debris"):AddItem(bul,0.25)
  261. local tweenService = game:GetService("TweenService")
  262. local timeToFade = 0.25
  263. local object = bul
  264. local tweenInfo = TweenInfo.new(timeToFade)
  265. local goal = {}
  266. local x,y,z = CFrame.new(part.Position + part.CFrame.lookVector * -3.75 + part.CFrame.upVector * 0.25,hitp.Position):ToEulerAnglesXYZ()
  267. goal.CFrame = bul.CFrame * CFrame.new(0,0,(bul.Position - result.Position).Magnitude * -2)
  268. local tween = tweenService:Create(object, tweenInfo, goal)
  269. tween:Play()
  270. local whathit = result.Instance
  271. local hole = Instance.new("SpawnLocation",workspace)
  272. hole.Enabled = false
  273. table.insert(rayblacklist,hole)
  274. hole.Shape = "Cylinder"
  275. hole.CanCollide = false
  276. hole.Size = Vector3.new(0.02,0.25,0.25)
  277. hole:BreakJoints()
  278. hole.Position = result.Position
  279. local currentRightVector = whathit.CFrame.RightVector
  280. local upVector = result.Normal
  281. local newFacialVector = currentRightVector:Cross(upVector)
  282. hole.CFrame = CFrame.fromMatrix(hole.Position, currentRightVector, upVector, newFacialVector) * CFrame.Angles(0,0,math.rad(90))
  283. local holeweld = Instance.new("WeldConstraint",whathit)
  284. holeweld.Part0 = hole
  285. holeweld.Part1 = whathit
  286. if whathit.Material == "Glass" or whathit.Material == Enum.Material.Glass then
  287. whathit:Destroy()
  288. end
  289. local humanoid = whathit.Parent:FindFirstChild("Humanoid") or whathit.Parent.Parent:FindFirstChild("Humanoid")
  290. hole.Color = Color3.fromRGB()
  291. hitsomething.Parent = hole
  292. local whatsound = math.random(1,2)
  293. if whatsound == 1 and not humanoid then
  294. hitsomething.SoundId = "rbxassetid://4427234167"
  295. hitsomething.Volume = 0.25
  296. hitsomething.Parent = nil
  297. elseif whatsound == 2 and not humanoid then
  298. hitsomething.SoundId = "rbxassetid://4427236368"
  299. hitsomething.Volume = 0.25
  300. hitsomething.Parent = nil
  301. end
  302. task.wait()
  303. if humanoid then
  304. humanoid.Health = humanoid.Health - damage
  305. end
  306. game:GetService("Debris"):AddItem(hole,30)
  307. if humanoid then
  308. hitsomething.Parent = hole
  309. hitsomething.SoundId = "rbxassetid://7441119598"
  310. hitsomething.Volume = 1
  311. task.wait()
  312. hitsomething.Parent = nil
  313. hole.BrickColor = BrickColor.new("Maroon")
  314. coroutine.wrap(function()
  315. for i = 1, 2 do
  316. wait(0.125)
  317. local bloodpartfloor = Instance.new("SpawnLocation", workspace)
  318. bloodpartfloor.Enabled = false
  319. bloodpartfloor.CanCollide = false
  320. local random2 = math.random(-5,5)
  321. local random3 = math.random(-5,5)
  322. bloodpartfloor.Size = Vector3.new(0.005,0.25,0.25)
  323. bloodpartfloor.CanCollide = false
  324. bloodpartfloor.Material = "Glass"
  325. bloodpartfloor.Shape = "Cylinder"
  326. bloodpartfloor.Anchored = true
  327. table.insert(rayblacklist,bloodpartfloor)
  328. local params2 = RaycastParams.new()
  329. params2.FilterDescendantsInstances = {whathit, owner.Character,rayblacklist}
  330. params2.FilterType = Enum.RaycastFilterType.Blacklist
  331. local result2 = workspace:Raycast(whathit.Position + Vector3.new(random2,0,random3), whathit.Position + Vector3.new(random2,-300,random3), params2)
  332. if result2 then
  333. bloodpartfloor.Position = result2.Position
  334. local currentRightVector2 = whathit.CFrame.RightVector
  335. local upVector2 = result2.Normal
  336. local newFacialVector2 = currentRightVector2:Cross(upVector2)
  337. bloodpartfloor.CFrame = CFrame.fromMatrix(bloodpartfloor.Position, currentRightVector2, upVector2, newFacialVector2) * CFrame.Angles(0,0,math.rad(90))
  338. bloodpartfloor.BrickColor = BrickColor.new("Maroon")
  339. game:GetService("Debris"):AddItem(bloodpartfloor,25)
  340. local tweenService = game:GetService("TweenService")
  341. local timeToFade = 10
  342. local object = bloodpartfloor
  343. local tweenInfo = TweenInfo.new(timeToFade)
  344. local goal = {}
  345. local random = math.random(0.25,5)
  346. goal.Size = Vector3.new(0.05,random,random)
  347. local grow = tweenService:Create(object, tweenInfo, goal)
  348. grow:Play()
  349. end
  350. end
  351. end)()
  352. end
  353. end
  354. end)()
  355. end
  356. end)()
  357. end
  358. end)
Add Comment
Please, Sign In to add comment