Advertisement
TheUnknownDiscord

revolver

Feb 26th, 2022 (edited)
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.29 KB | None | 0 0
  1. hitsomething = Instance.new("Sound", script)
  2. hitsomething.PlayOnRemove = true
  3. hitsomething2 = Instance.new("Sound", script)
  4. hitsomething2.PlayOnRemove = true
  5. rayblacklist = {}
  6. local E = Instance.new("RemoteEvent",owner.Character)
  7. NLS([[
  8. local E = owner.Character:FindFirstChildWhichIsA("RemoteEvent")
  9. local Mouse = owner:GetMouse()
  10. function ButtonDown()
  11. E:FireServer(Mouse.Hit)
  12. end
  13. Mouse.Button1Down:Connect(ButtonDown)
  14. ]],owner.PlayerGui)
  15. tool = Instance.new("Tool",owner.Backpack)
  16. script = tool
  17. part = Instance.new("Part",script)
  18. part.Anchored = true
  19. part.Shape = "Cylinder"
  20. part.Size = Vector3.new(2,2,2)
  21. part2 = Instance.new("Part",script)
  22. part2.Anchored = true
  23. part2.Shape = "Cylinder"
  24. part2.Size = Vector3.new(2,0.55,0.55)
  25. part2.CFrame = CFrame.new(0.35,-0.925,0.625)
  26. part3 = Instance.new("Part",script)
  27. part3.Anchored = true
  28. part3.Shape = "Cylinder"
  29. part3.Size = Vector3.new(2,0.5,0.5)
  30. part3.CFrame = CFrame.new(0.35,1.025,0)
  31. part4 = Instance.new("Part",script)
  32. part4.Anchored = true
  33. part4.Shape = "Cylinder"
  34. part4.Size = Vector3.new(2,0.55,0.55)
  35. part4.CFrame = CFrame.new(0.35,-0.925,-0.625)
  36. part5 = Instance.new("Part",script)
  37. part5.Anchored = true
  38. part5.Shape = "Cylinder"
  39. part5.Size = Vector3.new(2,0.5,0.5)
  40. part5.CFrame = CFrame.new(0.35,0.425,-1.025)
  41. part6 = Instance.new("Part",script)
  42. part6.Anchored = true
  43. part6.Shape = "Cylinder"
  44. part6.Size = Vector3.new(2,0.5,0.5)
  45. part6.CFrame = CFrame.new(0.35,0.425,1.025)
  46. part7 = Instance.new("Part",script)
  47. part7.Anchored = true
  48. part7.Shape = "Cylinder"
  49. part7.Size = Vector3.new(2,0.45,0.45)
  50. part7.CFrame = CFrame.new(0,-0.625,0)
  51. part8 = Instance.new("Part",script)
  52. part8.Anchored = true
  53. part8.Shape = "Cylinder"
  54. part8.Size = Vector3.new(2,0.45,0.45)
  55. part8.CFrame = CFrame.new(0,-0.2125,0.625)
  56. part9 = Instance.new("Part",script)
  57. part9.Anchored = true
  58. part9.Shape = "Cylinder"
  59. part9.Size = Vector3.new(2,0.45,0.45)
  60. part9.CFrame = CFrame.new(0,-0.2125,-0.625)
  61. part10 = Instance.new("Part",script)
  62. part10.Anchored = true
  63. part10.Shape = "Cylinder"
  64. part10.Size = Vector3.new(2,0.45,0.45)
  65. part10.CFrame = CFrame.new(0,0.475,0.345)
  66. part11 = Instance.new("Part",script)
  67. part11.Anchored = true
  68. part11.Shape = "Cylinder"
  69. part11.Size = Vector3.new(2,0.45,0.45)
  70. part11.CFrame = CFrame.new(0,0.475,-0.345)
  71. part12 = Instance.new("Part",script)
  72. part12.Anchored = true
  73. part12.Shape = "Cylinder"
  74. part12.Size = Vector3.new(2,0.5,0.5)
  75. part12.CFrame = CFrame.new(0.5,0,0)
  76. buls = Instance.new("Part",script)
  77. buls.Anchored = true
  78. buls.Shape = "Cylinder"
  79. buls.Size = Vector3.new(0.75,0.225,0.225)
  80. buls2 = Instance.new("Part",script)
  81. buls2.Anchored = true
  82. buls2.Shape = "Cylinder"
  83. buls2.Size = Vector3.new(0.01875,0.235,0.235)
  84. buls2.CFrame = CFrame.new(-0.375,0,0)
  85. buls3 = Instance.new("Part",script)
  86. buls3.Anchored = true
  87. buls3.Shape = "Ball"
  88. buls3.Size = Vector3.new(0.2225,0.2225,0.2225)
  89. buls3.CFrame = CFrame.new(0.375,0,0)
  90. buls3.Color = Color3.fromRGB(235, 213, 19)
  91. buls.Color = Color3.fromRGB(235, 213, 19)
  92. buls2.Color = Color3.fromRGB(227, 205, 16)
  93. trigs = Instance.new("Part",script)
  94. trigs.Anchored = true
  95. trigs.Shape = "Cylinder"
  96. trigs.Size = Vector3.new(0.125,0.5,0.5)
  97. trigs2 = Instance.new("Part",script)
  98. trigs2.Anchored = true
  99. trigs2.Shape = "Cylinder"
  100. trigs2.Size = Vector3.new(0.5,0.5,0.5)
  101. trigs2.CFrame = CFrame.new(0,0.025,0.0625)
  102. trigs3 = Instance.new("Part",script)
  103. trigs3.Anchored = true
  104. trigs3.Shape = "Cylinder"
  105. trigs3.Size = Vector3.new(0.5,0.5,0.5)
  106. trigs3.CFrame = CFrame.new(0,0.1,0.0625)
  107. ope = Instance.new("Part",script)
  108. ope.Anchored = true
  109. ope.Size = Vector3.new(0.125,0.5,0.225)
  110. ope2 = Instance.new("Part",script)
  111. ope2.Anchored = true
  112. ope2.Size = Vector3.new(0.125,0.225,0.225)
  113. ope2.Shape = "Cylinder"
  114. ope2.CFrame = CFrame.new(0,0.25,0)
  115. ope3 = Instance.new("Part",script)
  116. ope3.Anchored = true
  117. ope3.Size = Vector3.new(0.125,0.225,0.225)
  118. ope3.Shape = "Cylinder"
  119. ope3.CFrame = CFrame.new(0,-0.25,0)
  120. local un2 = part:UnionAsync({part12})
  121. task.wait()
  122. part:Destroy()
  123. part12:Destroy()
  124. un2.Parent = script
  125. local table3 = {part2,part3,part4,part5,part6,part7,part8,part9,part10,part11}
  126. local table2 = {part2,part3,part4,part5,part6}
  127. for i,v in pairs(table2) do
  128. local par = Instance.new("Part",script)
  129. par.Anchored = true
  130. par.Shape = "Ball"
  131. local siz = v.Size.Y - 0.02125
  132. par.Size = Vector3.new(siz,siz,siz)
  133. par.CFrame = v.CFrame * CFrame.new(-1,0,0)
  134. table.insert(table3,par)
  135. end
  136. task.wait()
  137. local union = un2:SubtractAsync(table3)
  138. trigr = trigs:SubtractAsync({trigs2,trigs3})
  139. local bul = buls:UnionAsync({buls2,buls3})
  140. local opener = ope:UnionAsync({ope2,ope3})
  141. task.wait()
  142. buls:Destroy()
  143. ope:Destroy()
  144. ope2:Destroy()
  145. ope3:Destroy()
  146. trigs:Destroy()
  147. trigs3:Destroy()
  148. trigs2:Destroy()
  149. buls3:Destroy()
  150. buls2:Destroy()
  151. for i,v in pairs(table3) do
  152. v:Destroy()
  153. end
  154. un2:Destroy()
  155. task.wait()
  156. union.Parent = script
  157. trigr.Parent = script
  158. trigr.CFrame = owner.Character.HumanoidRootPart.CFrame
  159. opener.Parent = script
  160. opener.Size = Vector3.new(0.09375,0.54,0.165)
  161. trigr.Size = Vector3.new(0.09375,0.3225,0.2775)
  162. union.CFrame = owner.Character.Head.CFrame
  163. opener.CFrame = union.CFrame * CFrame.new(0.35,-0.175,0)
  164. local wels = Instance.new("Weld",opener)
  165. wels.Part0 = union
  166. wels.Part1 = opener
  167. union.Anchored = false
  168. wels.C1 = CFrame.new(-0.35,0.175,0)
  169. local part = Instance.new("Part",script)
  170. part.Anchored = true
  171. part.CFrame = opener.CFrame * CFrame.new(-0.625,-0.25,0)
  172. part.Size = Vector3.new(1,0.0625,0.35)
  173. local part4 = Instance.new("Part",script)
  174. part4.Size = Vector3.new(0.5,0.15,0.15)
  175. local part5 = Instance.new("Part",script)
  176. part5.Size = Vector3.new(1,0.0625,0.35)
  177. part4.Shape = "Cylinder"
  178. gunp = part4
  179. local wels2 = Instance.new("Weld",part)
  180. wels2.Part0 = opener
  181. wels2.Part1 = part
  182. local wels7 = Instance.new("Weld",part)
  183. wels7.Part0 = part5
  184. wels7.Part1 = part
  185. wels7.C0 = CFrame.new(-0.175,-0.7,0)
  186. opener.Anchored = false
  187. wels2.C1 = CFrame.new(0.625,0.25,0)
  188. local part2 = Instance.new("Part",script)
  189. part2.Anchored = true
  190. part2.CFrame = opener.CFrame * CFrame.new(-0.925,0,0)
  191. part2.Size = Vector3.new(0.45,0.5,0.35)
  192. local part3 = Instance.new("Part",script)
  193. part3.Anchored = true
  194. part3.CFrame = opener.CFrame * CFrame.new(-1.325,-0.25,0) * CFrame.Angles(0,0,math.rad(-15))
  195. part3.Size = Vector3.new(0.45,0.75,0.25)
  196. local part6 = Instance.new("Part",script)
  197. part6.Size = Vector3.new(0.5,0.85,0.225)
  198. local wels4 = Instance.new("WeldConstraint",part)
  199. wels4.Part0 = part2
  200. wels4.Part1 = part
  201. local wels5 = Instance.new("WeldConstraint",part)
  202. wels5.Part0 = part3
  203. wels5.Part1 = part
  204. local wels7 = Instance.new("Weld",part3)
  205. wels7.Part0 = part6
  206. wels7.Part1 = part3
  207. trigr.CFrame = part2.CFrame * CFrame.new(0,-0.5,0) * CFrame.Angles(0,math.rad(90),0)
  208. local wels3 = Instance.new("Weld",part2)
  209. wels3.Part0 = trigr
  210. wels3.Part1 = part2
  211. trigr.Anchored = false
  212. wels3.C1 = CFrame.new(0,-0.25,0) * CFrame.Angles(0,math.rad(90),0)
  213. wels3.C0 = CFrame.new(0,0.25,0)
  214. wels.C0 = wels.C0 * CFrame.Angles(math.rad(35),0,0)
  215. part2.Anchored = false
  216. for i,v in pairs(tool:GetChildren()) do
  217. v.Material = "Metal"
  218. table.insert(rayblacklist,v)
  219. end
  220. part3.Material = "Wood"
  221. part3.Color = Color3.fromRGB(102, 51, 0)
  222. part6.Material = "Sand"
  223. part6.Color = Color3.fromRGB(60,60,60)
  224. part.Anchored = false
  225. TweenService = game:GetService("TweenService")
  226. spininfo = TweenInfo.new(0.1125,Enum.EasingStyle.Linear)
  227. openp = TweenService:Create(wels2,spininfo,{C0 = wels2.C0 * CFrame.new(0,-0.15,0.325) * CFrame.Angles(math.rad(35),0,0)})
  228. openp2 = TweenService:Create(wels2,spininfo,{C0 = wels2.C0})
  229. fir = TweenService:Create(wels3,TweenInfo.new(0.0625,Enum.EasingStyle.Linear),{C0 = wels3.C0 * CFrame.Angles(math.rad(-35),0,0)})
  230. fir2 = TweenService:Create(wels3,TweenInfo.new(0.0625,Enum.EasingStyle.Linear),{C0 = wels3.C0})
  231. Spin1 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(-120),0,0)})
  232. Spin2 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(-240),0,0)})
  233. Spin3 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(-360),0,0)})
  234. union.Size = Vector3.new(0.625,0.5,0.5)
  235. task.wait()
  236. part3.Anchored = false
  237. part3.Name = "Handle"
  238. part3.Parent = tool
  239. tool.Equipped:Wait()
  240. wait(0.5)
  241. openp:Play()
  242. bul.Parent = script
  243. bul.Size = Vector3.new(0.46125,0.1175,0.1175)
  244. bul.CFrame = union.CFrame * CFrame.new(-0.5,0.11875,-0.08625)
  245. local bul2 = bul:Clone()
  246. bul2.CFrame = union.CFrame * CFrame.new(-0.5,0.11875,0.08625)
  247. bul2.Parent = script
  248. local bul3 = bul:Clone()
  249. bul3.CFrame = union.CFrame * CFrame.new(-0.5,-0.15625,0)
  250. bul3.Parent = script
  251. local bul4 = bul:Clone()
  252. bul4.CFrame = union.CFrame * CFrame.new(-0.5,-0.053125,0.15625)
  253. bul4.Parent = script
  254. local bul5 = bul:Clone()
  255. bul5.CFrame = union.CFrame * CFrame.new(-0.5,-0.053125,-0.15625)
  256. bul5.Parent = script
  257. local bullets = {bul,bul2,bul4,bul3,bul5}
  258. for i,v in pairs(bullets) do
  259. v.CanCollide = false
  260. v.Anchored = false
  261. end
  262. bwel = Instance.new("Weld",union)
  263. bwel.Part0 = bul
  264. bwel.Part1 = union
  265. bwel.C0 = CFrame.new(-0.5,0.11875,-0.08625):Inverse()
  266. bwel2 = Instance.new("Weld",union)
  267. bwel2.Part0 = bul2
  268. bwel2.Part1 = union
  269. bwel2.C0 = CFrame.new(-0.5,0.11875,0.08625):Inverse()
  270. bwel3 = Instance.new("Weld",union)
  271. bwel3.Part0 = bul3
  272. bwel3.Part1 = union
  273. bwel3.C0 = CFrame.new(-0.5,-0.15625,0):Inverse()
  274. bwel4 = Instance.new("Weld",union)
  275. bwel4.Part0 = bul4
  276. bwel4.Part1 = union
  277. bwel4.C0 = CFrame.new(-0.5,-0.053125,0.15625):Inverse()
  278. bwel5 = Instance.new("Weld",union)
  279. bwel5.Part0 = bul5
  280. bwel5.Part1 = union
  281. bwel5.C0 = CFrame.new(-0.5,-0.053125,-0.15625):Inverse()
  282. local wels6 = Instance.new("Weld",part2)
  283. wels6.Part0 = part4
  284. wels6.Part1 = part2
  285. wels6.C0 = CFrame.new(-1.25,-0.3,0)
  286. trigr.Anchored = false
  287. function bulweld()
  288. local tweenService = game:GetService("TweenService")
  289. local timeToFade = 0.5
  290. local object = bwel
  291. local tweenInfo = TweenInfo.new(timeToFade)
  292. local goal = {}
  293. goal.C0 = bwel.C0 * CFrame.new(-0.3975,0,0)
  294.  
  295. local tween = tweenService:Create(object, tweenInfo, goal)
  296. tween:Play()
  297. local tweenService = game:GetService("TweenService")
  298. local timeToFade = 0.5
  299. local object = bwel2
  300. local tweenInfo = TweenInfo.new(timeToFade)
  301. local goal = {}
  302. goal.C0 = bwel2.C0 * CFrame.new(-0.3975,0,0)
  303.  
  304. local tween = tweenService:Create(object, tweenInfo, goal)
  305. tween:Play()
  306. local tweenService = game:GetService("TweenService")
  307. local timeToFade = 0.5
  308. local object = bwel3
  309. local tweenInfo = TweenInfo.new(timeToFade)
  310. local goal = {}
  311. goal.C0 = bwel3.C0 * CFrame.new(-0.3975,0,0)
  312.  
  313. local tween = tweenService:Create(object, tweenInfo, goal)
  314. tween:Play()
  315. local tweenService = game:GetService("TweenService")
  316. local timeToFade = 0.5
  317. local object = bwel4
  318. local tweenInfo = TweenInfo.new(timeToFade)
  319. local goal = {}
  320. goal.C0 = bwel4.C0 * CFrame.new(-0.3975,0,0)
  321.  
  322. local tween = tweenService:Create(object, tweenInfo, goal)
  323. tween:Play()
  324. local tweenService = game:GetService("TweenService")
  325. local timeToFade = 0.5
  326. local object = bwel5
  327. local tweenInfo = TweenInfo.new(timeToFade)
  328. local goal = {}
  329. goal.C0 = bwel5.C0 * CFrame.new(-0.3975,0,0)
  330.  
  331. local tween = tweenService:Create(object, tweenInfo, goal)
  332. tween:Play()
  333. end
  334. function bulweld2()
  335. local tweenService = game:GetService("TweenService")
  336. local timeToFade = 0.5
  337. local object = bwel
  338. local tweenInfo = TweenInfo.new(timeToFade)
  339. local goal = {}
  340. goal.C0 = bwel.C0 * CFrame.new(0.3975,0,0)
  341.  
  342. local tween = tweenService:Create(object, tweenInfo, goal)
  343. tween:Play()
  344. local tweenService = game:GetService("TweenService")
  345. local timeToFade = 0.5
  346. local object = bwel2
  347. local tweenInfo = TweenInfo.new(timeToFade)
  348. local goal = {}
  349. goal.C0 = bwel2.C0 * CFrame.new(0.3975,0,0)
  350.  
  351. local tween = tweenService:Create(object, tweenInfo, goal)
  352. tween:Play()
  353. local tweenService = game:GetService("TweenService")
  354. local timeToFade = 0.5
  355. local object = bwel3
  356. local tweenInfo = TweenInfo.new(timeToFade)
  357. local goal = {}
  358. goal.C0 = bwel3.C0 * CFrame.new(0.3975,0,0)
  359.  
  360. local tween = tweenService:Create(object, tweenInfo, goal)
  361. tween:Play()
  362. local tweenService = game:GetService("TweenService")
  363. local timeToFade = 0.5
  364. local object = bwel4
  365. local tweenInfo = TweenInfo.new(timeToFade)
  366. local goal = {}
  367. goal.C0 = bwel4.C0 * CFrame.new(0.3975,0,0)
  368.  
  369. local tween = tweenService:Create(object, tweenInfo, goal)
  370. tween:Play()
  371. local tweenService = game:GetService("TweenService")
  372. local timeToFade = 0.5
  373. local object = bwel5
  374. local tweenInfo = TweenInfo.new(timeToFade)
  375. local goal = {}
  376. goal.C0 = bwel5.C0 * CFrame.new(0.3975,0,0)
  377.  
  378. local tween = tweenService:Create(object, tweenInfo, goal)
  379. tween:Play()
  380. end
  381. bulweld()
  382. wait(0.65)
  383. tool.Grip = CFrame.Angles(0,math.rad(-90),0) * CFrame.Angles(math.rad(15),0,0)
  384. Spin1:Play()
  385. local count = 0
  386. Spin1.Completed:Connect(function()Spin2:Play() end)
  387. Spin2.Completed:Connect(function()Spin3:Play() end)
  388. Spin3.Completed:Connect(function() if count ~= 3 then count += 1 Spin1:Play() else count = 0 end end)
  389. openp2:Play()
  390. wait(0.5)
  391. local shots = 0
  392. canshoot = true
  393. function reload()
  394. if canshoot then
  395. canshoot = false
  396. openp:Play()
  397. wait(0.5)
  398. bulweld2()
  399. wait(0.5)
  400. bulweld()
  401. openp2:Play()
  402. Spin1 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(120),0,0)})
  403. Spin2 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(240),0,0)})
  404. Spin3 = TweenService:Create(wels,spininfo,{C0 = wels.C0 * CFrame.Angles(math.rad(360),0,0)})
  405. Spin1.Completed:Connect(function()Spin2:Play() end)
  406. Spin2.Completed:Connect(function()Spin3:Play() end)
  407. Spin3.Completed:Connect(function() if count ~= 1 then count += 1 Spin1:Play() else count = 0 end end)
  408. Spin1:Play()
  409. shots = 0
  410. canshoot = true
  411. end
  412. end
  413. function shoot()
  414. if canshoot then
  415. task.wait()
  416. canshoot = false
  417. fir:Play()
  418. shots += 1
  419. local tweenService = game:GetService("TweenService")
  420. local timeToFade = 0.125
  421. local object = wels
  422. local tweenInfo = TweenInfo.new(timeToFade)
  423. local goal = {}
  424. goal.C0 = wels.C0 * CFrame.Angles(math.rad(72),0,0)
  425.  
  426. local tween = tweenService:Create(object, tweenInfo, goal)
  427. tween:Play()
  428. wait(0.125)
  429. fir2:Play()
  430. canshoot = true
  431. end
  432. end
  433. toolout = false
  434. tool.Equipped:Connect(function() toolout = true end)
  435. tool.Unequipped:Connect(function() toolout = false end)
  436. tool.Activated:Connect(shoot)
  437. prox = Instance.new("ProximityPrompt",tool.Handle)
  438. prox.Style = Enum.ProximityPromptStyle.Custom
  439. prox.Enabled = true
  440. prox.KeyboardKeyCode = Enum.KeyCode.R
  441. prox.Triggered:Connect(function(player)
  442. if player == owner then
  443. reload()
  444. end
  445. end)
  446. E.OnServerEvent:Connect(function(plr,hitp)
  447. if shots <= 4 and toolout and canshoot then
  448. hitsomething2.SoundId = "rbxassetid://6150723164"
  449. hitsomething2.Volume = 1
  450. hitsomething2.Parent = gunp
  451. hitsomething2.Parent = nil
  452. damage = math.random(15,35)
  453. local bul = Instance.new("SpawnLocation",script)
  454. bul.Enabled = false
  455. bul.Anchored = true
  456. local x,y,z = CFrame.new(gunp.Position,hitp.Position):ToEulerAnglesXYZ()
  457. bul.CFrame = CFrame.new(gunp.Position + gunp.CFrame.rightVector * 0.5) * CFrame.Angles(x,y,z)
  458. bul.Size = Vector3.new(0.1,0.1,1)
  459. bul.CanCollide = false
  460. bul.Material = "Neon"
  461. table.insert(rayblacklist,bul)
  462. local params = RaycastParams.new()
  463. params.FilterDescendantsInstances = {owner.Character,rayblacklist}
  464. params.FilterType = Enum.RaycastFilterType.Blacklist
  465. local result = game.Workspace:Raycast(gunp.Position + gunp.CFrame.rightVector * 0.5, (hitp.Position - gunp.Position).Unit*500,params)
  466. if not result then
  467. game:GetService("Debris"):AddItem(bul,5)
  468. local tweenService = game:GetService("TweenService")
  469. local timeToFade = 5
  470. local object = bul
  471. local tweenInfo = TweenInfo.new(timeToFade)
  472. local goal = {}
  473. goal.CFrame = bul.CFrame * CFrame.new(0,0,-1000)
  474. goal.Transparency = 1
  475. local tween = tweenService:Create(object, tweenInfo, goal)
  476. tween:Play()
  477. elseif result then
  478. game:GetService("Debris"):AddItem(bul,0.25)
  479. local tweenService = game:GetService("TweenService")
  480. local timeToFade = 0.25
  481. local object = bul
  482. local tweenInfo = TweenInfo.new(timeToFade)
  483. local goal = {}
  484. local x,y,z = CFrame.new(gunp.Position,hitp.Position):ToEulerAnglesXYZ()
  485. goal.CFrame = bul.CFrame * CFrame.new(0,0,(bul.Position - result.Position).Magnitude * -2)
  486. local tween = tweenService:Create(object, tweenInfo, goal)
  487. tween:Play()
  488. local whathit = result.Instance
  489. local hole = Instance.new("SpawnLocation",workspace)
  490. hole.Enabled = false
  491. table.insert(rayblacklist,hole)
  492. hole.Shape = "Cylinder"
  493. hole.CanCollide = false
  494. hole.Size = Vector3.new(0.02,0.35,0.35)
  495. hole:BreakJoints()
  496. hole.Position = result.Position
  497. local currentRightVector = whathit.CFrame.RightVector
  498. local upVector = result.Normal
  499. local newFacialVector = currentRightVector:Cross(upVector)
  500. hole.CFrame = CFrame.fromMatrix(hole.Position, currentRightVector, upVector, newFacialVector) * CFrame.Angles(0,0,math.rad(90))
  501. if whathit.Anchored == false then
  502. local holeweld = Instance.new("WeldConstraint",whathit)
  503. holeweld.Part0 = hole
  504. holeweld.Part1 = whathit
  505. elseif whathit.Anchored == true then
  506. hole.Anchored = true
  507. end
  508. if whathit.Material == "Glass" then
  509. whathit:Destroy()
  510. end
  511. local humanoid = whathit.Parent:FindFirstChild("Humanoid") or whathit.Parent.Parent:FindFirstChild("Humanoid")
  512. hole.Color = Color3.fromRGB()
  513. local pe = Instance.new("ParticleEmitter", hole)
  514. pe.Color = ColorSequence.new(whathit.Color)
  515. pe.LightEmission = 0
  516. pe.LightInfluence = 1
  517. pe.EmissionDirection = "Right"
  518. pe.Orientation = Enum.ParticleOrientation.VelocityParallel
  519. pe.Size = NumberSequence.new(0.5,0)
  520. pe.Texture = "rbxassetid://243132757"
  521. pe.Transparency = NumberSequence.new(0,0.4)
  522. pe.Lifetime = NumberRange.new(0.15,0.45)
  523. pe.Rate = 300
  524. pe.Rotation = NumberRange.new(90)
  525. pe.RotSpeed = NumberRange.new(0)
  526. pe.Speed = NumberRange.new(10)
  527. pe.SpreadAngle = Vector2.new(-15,15)
  528. pe.Drag = NumberRange.new(1)
  529. rand = math.random
  530. pe.Acceleration = Vector3.new(rand(-20,20),-50,rand(-20,20))
  531. hitsomething.Parent = hole
  532. local whatsound = math.random(1,3)
  533. if whatsound == 1 and not humanoid then
  534. hitsomething.SoundId = "rbxassetid://4427232788"
  535. hitsomething.Volume = 1
  536. hitsomething.Parent = nil
  537. elseif whatsound == 2 and not humanoid then
  538. hitsomething.SoundId = "rbxassetid://4427234167"
  539. hitsomething.Volume = 1
  540. hitsomething.Parent = nil
  541. elseif whatsound == 3 and not humanoid then
  542. hitsomething.SoundId = "rbxassetid://4427236368"
  543. hitsomething.Volume = 1
  544. hitsomething.Parent = nil
  545. end
  546. task.wait()
  547. if whathit.Name ~= "Head" and humanoid then
  548. humanoid.Health = humanoid.Health - damage
  549. elseif whathit.Name == "Head" and humanoid then
  550. humanoid.Health = 0
  551. end
  552. game:GetService("Debris"):AddItem(hole,30)
  553. if humanoid then
  554. hitsomething.Parent = hole
  555. hitsomething.SoundId = "rbxassetid://7441119598"
  556. hitsomething.Volume = 1
  557. task.wait()
  558. hitsomething.Parent = nil
  559. hole.BrickColor = BrickColor.new("Maroon")
  560. game:GetService("Debris"):AddItem(pe,10)
  561. pe.Size = NumberSequence.new(1,0)
  562. pe.Color = ColorSequence.new(Color3.fromRGB(100,0,0))
  563. coroutine.wrap(function()
  564. for i = 1, 20 do
  565. wait(0.125)
  566. local bloodpartfloor = Instance.new("SpawnLocation", workspace)
  567. bloodpartfloor.Enabled = false
  568. bloodpartfloor.CanCollide = false
  569. local random2 = math.random(-5,5)
  570. local random3 = math.random(-5,5)
  571. bloodpartfloor.Size = Vector3.new(0.005,0.25,0.25)
  572. bloodpartfloor.CanCollide = false
  573. bloodpartfloor.Material = "Glass"
  574. bloodpartfloor.Shape = "Cylinder"
  575. bloodpartfloor.Anchored = true
  576. table.insert(rayblacklist,bloodpartfloor)
  577. local params2 = RaycastParams.new()
  578. params2.FilterDescendantsInstances = {whathit, owner.Character,rayblacklist}
  579. params2.FilterType = Enum.RaycastFilterType.Blacklist
  580. local result2 = workspace:Raycast(whathit.Position + Vector3.new(random2,0,random3), whathit.Position + Vector3.new(random2,-300,random3), params2)
  581. if result2 then
  582. bloodpartfloor.Position = result2.Position
  583. local currentRightVector2 = whathit.CFrame.RightVector
  584. local upVector2 = result2.Normal
  585. local newFacialVector2 = currentRightVector2:Cross(upVector2)
  586. bloodpartfloor.CFrame = CFrame.fromMatrix(bloodpartfloor.Position, currentRightVector2, upVector2, newFacialVector2) * CFrame.Angles(0,0,math.rad(90))
  587. bloodpartfloor.BrickColor = BrickColor.new("Maroon")
  588. game:GetService("Debris"):AddItem(bloodpartfloor,25)
  589. local tweenService = game:GetService("TweenService")
  590. local timeToFade = 10
  591. local object = bloodpartfloor
  592. local tweenInfo = TweenInfo.new(timeToFade)
  593. local goal = {}
  594. local random = math.random(0.25,5)
  595. goal.Size = Vector3.new(0.05,random,random)
  596. local grow = tweenService:Create(object, tweenInfo, goal)
  597. grow:Play()
  598. end
  599. end
  600. end)()
  601. else
  602. coroutine.wrap(function()
  603. game:GetService("Debris"):AddItem(pe,2)
  604. wait(0.35)
  605. pe.Enabled = false
  606. end)()
  607. end
  608. end
  609. elseif shots > 4 and toolout and canshoot then
  610. hitsomething2.SoundId = "rbxassetid://7432036929"
  611. hitsomething2.Volume = 1
  612. hitsomething2.Parent = gunp
  613. hitsomething2.Parent = nil
  614. end
  615. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement