TheUnknownDiscord

shotgun

Feb 24th, 2022 (edited)
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.27 KB | None | 0 0
  1. rayblacklist = {}
  2. canfire = true
  3. local times = 2
  4. local count = 0
  5. local ang
  6. local shot = Instance.new("Sound")
  7. shot.SoundId = "rbxassetid://6839481031"
  8. shot.PlayOnRemove = true
  9. shot.TimePosition = 0.2
  10. shot.Volume = 2
  11. tool = Instance.new("Tool",owner.Backpack)
  12. part = Instance.new("Part",tool)
  13. part.Name = "Handle"
  14. local Mesh2 = Instance.new("SpecialMesh")
  15. Mesh2.Parent = part
  16. Mesh2.MeshId = "http://www.roblox.com/asset/?id=4711447529"
  17. Mesh2.TextureId = "http://www.roblox.com/asset/?id=4711447557"
  18. Mesh2.Scale = Vector3.new(0.06666666666,0.06666666666,0.06666666666)
  19. part.Size = Vector3.new(0.4152,0.98326666666,3.33333333333)
  20. part2 = Instance.new("Part",owner.Character)
  21. part2.CanTouch = false
  22. part2.CanCollide = false
  23. local Mesh = Instance.new("SpecialMesh")
  24. Mesh.Parent = part2
  25. Mesh.MeshId = "http://www.roblox.com/asset/?id=4711447529"
  26. Mesh.TextureId = "http://www.roblox.com/asset/?id=4711447557"
  27. Mesh.Scale = Vector3.new(0.06666666666,0.06666666666,0.06666666666)
  28. part2.Size = Vector3.new(0.4152,0.98326666666,3.33333333333)
  29. local weld = Instance.new("Weld",owner.Character.HumanoidRootPart)
  30. weld.Part0 = part2
  31. weld.Part1 = owner.Character.HumanoidRootPart
  32. weld.C0 = CFrame.new(-0.75,0,0) * CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(0,0,math.rad(45))
  33. tool.Equipped:Connect(function()
  34. toolout = true
  35. part2.Transparency = 1
  36. count += 1
  37. delay(0.75,function()
  38. if count ~= 1 then
  39. times = 6
  40. count = 0
  41. Mesh2.VertexColor = Vector3.new(1,0,0)
  42. else
  43. times = 2
  44. Mesh2.VertexColor = Vector3.new(1, 1, 1)
  45. count = 0
  46. end
  47. end)
  48. end)
  49. tool.Unequipped:Connect(function()
  50. toolout = false
  51. part2.Transparency = 0
  52. end)
  53. local E = Instance.new("RemoteEvent",owner.Character)
  54. NLS([[
  55. local E = owner.Character:FindFirstChildWhichIsA("RemoteEvent")
  56. local Mouse = owner:GetMouse()
  57. function ButtonDown()
  58. if Mouse.Target ~= nil then
  59. local damage = 4
  60. E:FireServer(Mouse.Hit,damage)
  61. end
  62. end
  63. Mouse.Button1Down:Connect(ButtonDown)
  64. Mouse.KeyDown:Connect(function(key)
  65. key = key:lower()
  66. if key == "q" and Mouse.Target ~= nil then
  67. E:FireServer(Mouse.Hit,nil,"true",Mouse.Target)
  68. wait(0.0625)
  69. owner.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
  70. wait(0.065 * (owner.Character:FindFirstChildWhichIsA("Tool").Handle.Position - Mouse.Hit.Position).Magnitude)
  71. owner.Character.Humanoid.Touched:Wait()
  72. owner.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Running)
  73. end
  74. end)
  75. ]],owner.PlayerGui)
  76. TweenService = game:GetService("TweenService")
  77. spininfo = TweenInfo.new(0.125,Enum.EasingStyle.Linear)
  78. spininfo2 = TweenInfo.new(0.0625,Enum.EasingStyle.Linear)
  79. spin = TweenService:Create(tool,spininfo,{Grip = CFrame.new(0,-0.5,1.5) * CFrame.Angles(math.rad(65),0,0)})
  80. Spin2 = TweenService:Create(tool,spininfo,{Grip = CFrame.new(0,-0.5,1.5)})
  81. recoil = TweenService:Create(tool,spininfo2,{Grip = CFrame.new(0,-0.5,1) * CFrame.Angles(math.rad(-25),0,0)})
  82. recoil2 = TweenService:Create(tool,spininfo2,{Grip = CFrame.new(0,-0.5,1.5)})
  83. spin.Completed:Connect(function()wait(0.125) Spin2:Play() end)
  84. recoil.Completed:Connect(function()wait(0.125) recoil2:Play() end)
  85. local isTouched = false
  86. hitsomething = Instance.new("Sound", script)
  87. hitsomething.PlayOnRemove = true
  88. local canhook = true
  89. E.OnServerEvent:Connect(function(plr,hitp,damage,key,hit)
  90. if key == nil then
  91. if toolout and canfire then
  92. canfire = false
  93. for i = 1, times do
  94. recoil:Play()
  95. shot.Parent = part
  96. shot.Parent = nil
  97. coroutine.wrap(function()
  98. for i = 1, 16 do
  99. task.wait()
  100. coroutine.wrap(function()
  101. if times ~= 2 then
  102. ang = CFrame.Angles(0,0,math.pi * 2 * math.random()) * CFrame.Angles(math.random() * math.rad(10),0,0)
  103. else
  104. ang = CFrame.Angles(0,0,math.pi * 2 * math.random()) * CFrame.Angles(math.random() * math.rad(15),0,0)
  105. end
  106. dir = part.Position
  107. dir = (CFrame.new(dir,hitp.Position) * ang).lookVector
  108. local params = RaycastParams.new()
  109. params.FilterDescendantsInstances = {part, owner.Character,rayblacklist}
  110. params.FilterType = Enum.RaycastFilterType.Blacklist
  111. local result = game.Workspace:Raycast(part.Position + part.CFrame.lookVector * 2, dir*500,params)
  112. local bul = Instance.new("SpawnLocation",script)
  113. bul.Enabled = false
  114. bul.Anchored = true
  115. table.insert(rayblacklist,bul)
  116. local x,y,z = CFrame.new(part.Position,hitp.Position):ToEulerAnglesXYZ()
  117. bul.CFrame = CFrame.new(part.Position + part.CFrame.lookVector * 2) * CFrame.Angles(x,y,z) * ang
  118. bul.Size = Vector3.new(0.1,0.1,1)
  119. bul.CanCollide = false
  120. bul.Material = "Neon"
  121. if not result then
  122. game:GetService("Debris"):AddItem(bul,5)
  123. local tweenService = game:GetService("TweenService")
  124. local timeToFade = 5
  125. local object = bul
  126. local tweenInfo = TweenInfo.new(timeToFade)
  127. local goal = {}
  128. goal.CFrame = bul.CFrame * CFrame.new(0,0,-1000)
  129. goal.Transparency = 1
  130. local tween = tweenService:Create(object, tweenInfo, goal)
  131. tween:Play()
  132. elseif result then
  133. game:GetService("Debris"):AddItem(bul,0.25)
  134. local tweenService = game:GetService("TweenService")
  135. local timeToFade = 0.25
  136. local object = bul
  137. local tweenInfo = TweenInfo.new(timeToFade)
  138. local goal = {}
  139. local x,y,z = CFrame.new(part.Position,hitp.Position):ToEulerAnglesXYZ()
  140. goal.CFrame = bul.CFrame * CFrame.new(0,0,(bul.Position - result.Position).Magnitude * -2)
  141. local tween = tweenService:Create(object, tweenInfo, goal)
  142. tween:Play()
  143. local whathit = result.Instance
  144. local hole = Instance.new("SpawnLocation",workspace)
  145. hole.Enabled = false
  146. table.insert(rayblacklist,hole)
  147. hole.Shape = "Cylinder"
  148. hole.CanCollide = false
  149. hole.Size = Vector3.new(0.02,0.25,0.25)
  150. hole:BreakJoints()
  151. hole.Position = result.Position
  152. local currentRightVector = whathit.CFrame.RightVector
  153. local upVector = result.Normal
  154. local newFacialVector = currentRightVector:Cross(upVector)
  155. hole.CFrame = CFrame.fromMatrix(hole.Position, currentRightVector, upVector, newFacialVector) * CFrame.Angles(0,0,math.rad(90))
  156. if whathit.Anchored == false then
  157. local holeweld = Instance.new("WeldConstraint",whathit)
  158. holeweld.Part0 = hole
  159. holeweld.Part1 = whathit
  160. elseif whathit.Anchored == true then
  161. hole.Anchored = true
  162. end
  163. if whathit.Material == "Glass" or whathit.Material == Enum.Material.Glass then
  164. whathit:Destroy()
  165. end
  166. local humanoid = whathit.Parent:FindFirstChild("Humanoid") or whathit.Parent.Parent:FindFirstChild("Humanoid")
  167. hole.Color = Color3.fromRGB()
  168. hitsomething.Parent = hole
  169. local whatsound = math.random(1,2)
  170. if whatsound == 1 and not humanoid then
  171. hitsomething.SoundId = "rbxassetid://4427234167"
  172. hitsomething.Volume = 0.25
  173. hitsomething.Parent = nil
  174. elseif whatsound == 2 and not humanoid then
  175. hitsomething.SoundId = "rbxassetid://4427236368"
  176. hitsomething.Volume = 0.25
  177. hitsomething.Parent = nil
  178. end
  179. task.wait()
  180. if humanoid then
  181. if times ~= 2 then
  182. humanoid.Health = humanoid.Health - damage * 4
  183. else
  184. humanoid.Health = humanoid.Health - damage
  185. end
  186. end
  187. game:GetService("Debris"):AddItem(hole,30)
  188. if humanoid then
  189. hitsomething.Parent = hole
  190. hitsomething.SoundId = "rbxassetid://7441119598"
  191. hitsomething.Volume = 1
  192. task.wait()
  193. hitsomething.Parent = nil
  194. hole.BrickColor = BrickColor.new("Maroon")
  195. coroutine.wrap(function()
  196. for i = 1, 2 do
  197. wait(0.125)
  198. local bloodpartfloor = Instance.new("SpawnLocation", workspace)
  199. bloodpartfloor.Enabled = false
  200. bloodpartfloor.CanCollide = false
  201. local random2 = math.random(-5,5)
  202. local random3 = math.random(-5,5)
  203. bloodpartfloor.Size = Vector3.new(0.005,0.25,0.25)
  204. bloodpartfloor.CanCollide = false
  205. bloodpartfloor.Material = "Glass"
  206. bloodpartfloor.Shape = "Cylinder"
  207. bloodpartfloor.Anchored = true
  208. table.insert(rayblacklist,bloodpartfloor)
  209. local params2 = RaycastParams.new()
  210. params2.FilterDescendantsInstances = {whathit, owner.Character,rayblacklist}
  211. params2.FilterType = Enum.RaycastFilterType.Blacklist
  212. local result2 = workspace:Raycast(whathit.Position + Vector3.new(random2,0,random3), whathit.Position + Vector3.new(random2,-300,random3), params2)
  213. if result2 then
  214. bloodpartfloor.Position = result2.Position
  215. local currentRightVector2 = whathit.CFrame.RightVector
  216. local upVector2 = result2.Normal
  217. local newFacialVector2 = currentRightVector2:Cross(upVector2)
  218. bloodpartfloor.CFrame = CFrame.fromMatrix(bloodpartfloor.Position, currentRightVector2, upVector2, newFacialVector2) * CFrame.Angles(0,0,math.rad(90))
  219. bloodpartfloor.BrickColor = BrickColor.new("Maroon")
  220. game:GetService("Debris"):AddItem(bloodpartfloor,25)
  221. local tweenService = game:GetService("TweenService")
  222. local timeToFade = 10
  223. local object = bloodpartfloor
  224. local tweenInfo = TweenInfo.new(timeToFade)
  225. local goal = {}
  226. local random = math.random(0.25,5)
  227. goal.Size = Vector3.new(0.05,random,random)
  228. local grow = tweenService:Create(object, tweenInfo, goal)
  229. grow:Play()
  230. end
  231. end
  232. end)()
  233. end
  234. end
  235. end)()
  236. end
  237. end)()
  238. recoil2.Completed:Wait()
  239. end
  240. wait(0.125)
  241. spin:Play()
  242. wait(0.25)
  243. wait(0.125)
  244. canfire = true
  245. end
  246. elseif key ~= nil and canhook then
  247. canhook = false
  248. ropep = Instance.new("Part",script)
  249. ropep.CanCollide = false
  250. ropep.Anchored = true
  251. ropep.Size = Vector3.new(0.25,0.25,0.1)
  252. ropep.CFrame = part.CFrame
  253. local attachment0 = Instance.new("Attachment")
  254. attachment0.Parent = ropep
  255. local attachment1 = Instance.new("Attachment")
  256. attachment1.Parent = part
  257. alignposition = Instance.new("RopeConstraint")
  258. alignposition.Parent = ropep
  259. alignposition.Attachment0 = attachment0
  260. alignposition.Attachment1 = attachment1
  261. alignposition.Visible = true
  262. alignposition.Length = (part.Position - ropep.Position).Magnitude
  263. alignposition.Thickness = 0.25
  264. alignposition.Restitution = 0
  265. local tweenService = game:GetService("TweenService")
  266. local timeToFade = 0.0625
  267. local object = ropep
  268. local tweenInfo = TweenInfo.new(timeToFade)
  269. local goal = {}
  270. goal.CFrame = hitp
  271.  
  272. local tween = tweenService:Create(object, tweenInfo, goal)
  273. tween:Play()
  274. task.wait()
  275. local tweenService = game:GetService("TweenService")
  276. local timeToFade = 0.0625
  277. local object = alignposition
  278. local tweenInfo = TweenInfo.new(timeToFade)
  279. local goal = {}
  280. goal.Length = (part.Position - hitp.Position).Magnitude
  281.  
  282. local tween = tweenService:Create(object, tweenInfo, goal)
  283. tween:Play()
  284. wait(0.0625)
  285. ropep.Anchored = false
  286. local weld = Instance.new("WeldConstraint",ropep)
  287. weld.Part0 = hit
  288. weld.Part1 = ropep
  289. game:GetService("Debris"):AddItem(ropep,0.065 * (part.Position - ropep.Position).Magnitude)
  290. owner.Character.HumanoidRootPart:ApplyImpulse(Vector3.new(0,1000,0))
  291. local tweenService = game:GetService("TweenService")
  292. local timeToFade = 0.0625 * (part.Position - ropep.Position).Magnitude
  293. local object = alignposition
  294. local tweenInfo = TweenInfo.new(timeToFade)
  295. local goal = {}
  296. goal.Length = (part.Position - ropep.Position).Magnitude * 0.125
  297.  
  298. local tween = tweenService:Create(object, tweenInfo, goal)
  299. tween:Play()
  300. wait(0.0625 * (part.Position - ropep.Position).Magnitude)
  301. owner.Character.HumanoidRootPart:ApplyImpulse(CFrame.new(part.Position,ropep.Position).lookVector * 5000)
  302. canhook = true
  303. end
  304. end)
  305. tool.Grip = CFrame.new(0,-0.5,1.5)
Add Comment
Please, Sign In to add comment