-----------------

BFG 50 reupload

May 11th, 2021 (edited)
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 69.23 KB | None | 0 0
  1. local plr = owner
  2. local char = plr.Character
  3. local hum = char:FindFirstChildOfClass("Humanoid")
  4. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  5. local rootpart = char:FindFirstChild("HumanoidRootPart")
  6.  
  7. local debris = game:GetService("Debris")
  8. local tween = game:GetService("TweenService")
  9.  
  10. local gun = Instance.new("Tool")
  11. local han = Instance.new("Part")
  12. local SpecialMesh2 = Instance.new("SpecialMesh")
  13. gun.Name = "BFG 50"
  14. gun.Parent = plr['Backpack']
  15. gun.Grip = CFrame.new(-0.497905374, -0.018754568, -1.70405805, -4.37113883e-08, 1, 0, 1, 4.37113883e-08, 8.74227695e-08, 8.74227766e-08, 3.82137093e-15, -0.99999994)
  16. han.Name = "Handle"
  17. han.Parent = gun
  18. han.CFrame = CFrame.new(-12.4460001, 1.07099998, -5.64400005, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  19. han.Position = Vector3.new(-12.4460001, 1.07099998, -5.64400005)
  20. han.Size = Vector3.new(1.44, 0.6, 7.19)
  21. han.BottomSurface = Enum.SurfaceType.Smooth
  22. han.TopSurface = Enum.SurfaceType.Smooth
  23. SpecialMesh2.Parent = han
  24. SpecialMesh2.MeshId = "rbxassetid://450273008"
  25. SpecialMesh2.Scale = Vector3.new(0.03, 0.03, 0.03)
  26. SpecialMesh2.TextureId = ""
  27. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  28.  
  29. local effect_part = Instance.new("Part")
  30. local smoke = Instance.new("ParticleEmitter")
  31. local flash = Instance.new("ParticleEmitter")
  32. local light = Instance.new("PointLight")
  33. effect_part.Name = "effect"
  34. effect_part.Parent = gun
  35. effect_part.CFrame = CFrame.new(-14.3099976, 2.64201403, -6.57999992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  36. effect_part.Position = Vector3.new(-14.3099976, 2.64201403, -6.57999992)
  37. effect_part.Transparency = 1
  38. effect_part.Size = Vector3.new(0.100000001, 0.100000001, 0.100000001)
  39. effect_part.BottomSurface = Enum.SurfaceType.Smooth
  40. effect_part.CanCollide = false
  41. effect_part.TopSurface = Enum.SurfaceType.Smooth
  42. smoke.Name = "smoke"
  43. smoke.Parent = effect_part
  44. smoke.Speed = NumberRange.new(5, 7)
  45. smoke.Rotation = NumberRange.new(0, 360)
  46. smoke.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
  47. smoke.Enabled = false
  48. smoke.LightEmission = 0.10000000149012
  49. smoke.Texture = "http://www.roblox.com/asset/?id=244514423"
  50. smoke.Transparency = NumberSequence.new(0.60000002384186,1)
  51. smoke.Size = NumberSequence.new(0.99999964237213,3)
  52. smoke.Lifetime = NumberRange.new(1.25, 1.5)
  53. smoke.Rate = 100
  54. smoke.RotSpeed = NumberRange.new(10, 10)
  55. smoke.SpreadAngle = Vector2.new(15, 15)
  56. smoke.VelocitySpread = 15
  57. flash.Name = "flash"
  58. flash.Parent = effect_part
  59. flash.Speed = NumberRange.new(0, 0)
  60. flash.Rotation = NumberRange.new(0, 90)
  61. flash.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
  62. flash.Enabled = false
  63. flash.LightEmission = 1
  64. flash.Texture = "http://www.roblox.com/asset/?id=3419963"
  65. flash.Transparency = NumberSequence.new(0.75,1)
  66. flash.Size = NumberSequence.new(0.20000000298023,0.20000000298023)
  67. flash.Lifetime = NumberRange.new(0.050000000745058, 0.075000002980232)
  68. flash.Rate = 1000
  69. light.Name = "light"
  70. light.Parent = effect_part
  71. light.Color = Color3.new(1, 1, 0.498039)
  72. light.Enabled = false
  73. light.Range = 6
  74. light.Brightness = 10
  75. light.Shadows = true
  76.  
  77. local weld = Instance.new("Weld")
  78. weld.Part0 = han
  79. weld.Part1 = effect_part
  80. weld.C1 = weld.C1 * CFrame.new(0,0,-han.Size.Z/2)
  81. weld.Parent = effect_part
  82.  
  83. local cols = {BrickColor.new("Neon orange"),BrickColor.new("Really red"),BrickColor.new("Bright red"),BrickColor.new("Br. yellowish orange"),BrickColor.new("Bright yellow")}
  84. local taunts = {298689061,2743459732,2852509470,1018518369}
  85. local using = false
  86. local op = true
  87. local bulletfire = 1
  88. local shootwait = 0.03*bulletfire
  89. local max_ammo = math.huge
  90. local ammo = max_ammo
  91. local hitpos = nil
  92. local shooting = false
  93. local equipped = false
  94.  
  95. local equip = Instance.new("Sound")
  96. equip.SoundId = 'rbxassetid://415269823'
  97. equip.Looped = true
  98. equip.Volume = 1
  99. equip.Parent = han
  100.  
  101. local shoot_s = Instance.new("Sound")
  102. shoot_s.Name = 'shoot'
  103. shoot_s.SoundId = 'rbxassetid://590136707'
  104. shoot_s.Volume = 4
  105. shoot_s.Parent = han
  106.  
  107. local reload_s = Instance.new("Sound")
  108. reload_s.SoundId = 'rbxassetid://3449328664'
  109. reload_s.Volume = 0.7
  110. reload_s.Parent = han
  111.  
  112. local wbreak = Instance.new("Sound")
  113. wbreak.Parent = han
  114. wbreak.SoundId = "rbxassetid://627558611"
  115. wbreak.TimePosition = .1
  116. wbreak.Volume = 0.7
  117.  
  118. function CheckIfAlive()
  119. local alive = false
  120. if plr and char and char.Parent and torso and torso.Parent and hum and hum.Parent and hum.Health > 0 then
  121. alive = true
  122. end
  123. return alive
  124. end
  125. function limb_collide(obj,mode)
  126. if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
  127. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  128. if not exists then
  129. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  130. end
  131. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  132. --
  133. local t = {}
  134. --
  135. local cb = Instance.new("Part")
  136. cb.Name = 'limb'
  137. cb.Transparency = 1
  138. cb.CanCollide = true
  139. cb.Anchored = false
  140. cb.CFrame = obj.CFrame
  141. cb.Size = obj.Size
  142. cb.Massless = true
  143. cb.Locked = true
  144. game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  145. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  146. local weld = Instance.new("Weld")
  147. weld.Part0 = cb
  148. weld.Part1 = obj
  149. weld.Parent = cb
  150. obj.Massless = true
  151. obj.Anchored = false
  152. if mode or obj:FindFirstChild("Dismembered") then
  153. cb.Parent = obj -- .Parent
  154. else
  155. cb.Parent = script
  156. table.insert(t,1,cb)
  157. end
  158. --
  159. if not string.match(obj.Name:lower(),'torso') and not string.match(obj.Name:lower(),'rootpart') and not string.match(obj.Name:lower(),'head') then
  160. local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
  161. local cb2 = Instance.new("Part")
  162. cb2.Name = 'limb'
  163. cb2.Transparency = 1
  164. cb2.CanCollide = true
  165. cb2.Anchored = false
  166. cb2.CFrame = obj.CFrame
  167. cb2.Size = lv
  168. cb2.Massless = true
  169. cb2.Locked = true
  170. local weld2 = Instance.new("Weld")
  171. weld2.Part0 = cb
  172. weld2.Part1 = cb2
  173. weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
  174. weld2.Parent = cb2
  175. if mode or obj:FindFirstChild("Dismembered") then
  176. cb2.Parent = obj -- .Parent
  177. else
  178. cb2.Parent = script
  179. table.insert(t,1,cb2)
  180. end
  181. end
  182. --
  183. return t
  184. end
  185. function Ragdoll(targchar,headless,insta,kill)
  186. local pc = targchar
  187. local targhum = pc:FindFirstChild("Humanoid")
  188. local js,js2 = {},{}
  189. for _,obj in pairs(pc:GetDescendants()) do
  190. if obj:IsA("BasePart") or obj:IsA("UnionOperation") then
  191. obj.Massless = true
  192. obj.Locked = true
  193. end
  194. end
  195. if kill == true then
  196. pc.Archivable = true
  197. local old_pc = pc
  198. pc = pc:Clone()
  199. for i,v in pairs(pc:GetDescendants()) do
  200. limb_collide(v,true)
  201. if v:IsA("ParticleEmitter") then
  202. v.Enabled = false
  203. end
  204. if v:IsA("SelectionBox") or v:IsA("BodyVelocity") or v:IsA("BodyPosition") or v:IsA("BodyAngularVelocity") or v:IsA("BodyForce") or v:IsA("BodyGyro") or v:IsA("BodyThrust") or v:IsA("BodyMover") then
  205. if v:IsA("BodyVelocity") then
  206. game:GetService("Debris"):AddItem(v,0.15)
  207. else
  208. v:Destroy()
  209. end
  210. end
  211. if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
  212. v:Destroy()
  213. end
  214. if v:IsA("Humanoid") then
  215. v.BreakJointsOnDeath = false
  216. v.Health = 0
  217. v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  218. v.PlatformStand = true
  219. end
  220. end
  221. for i,v in pairs(old_pc:GetDescendants()) do
  222. if v:IsA("BasePart") or v:IsA("UnionOperation") or v:IsA("ForceField") or v:IsA("Accessory") or v:IsA("Decal") or v:IsA("Texture") or v:IsA("SurfaceGui") then
  223. v:destroy()
  224. end
  225. if v:IsA("Humanoid") then
  226. v.BreakJointsOnDeath = true
  227. v.Health = 0
  228. v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  229. v.PlatformStand = true
  230. end
  231. end
  232. pc.Parent = workspace
  233. game:GetService("Debris"):AddItem(pc,30)
  234. end
  235. --if kill and targhum:FindFirstChild("Ragdolled") then return; end;
  236. if pc ~= nil then
  237. local hum = pc:FindFirstChild'Humanoid'
  238. local LArm = pc:FindFirstChild'Left Arm'
  239. local RArm = pc:FindFirstChild'Right Arm'
  240. local LLeg = pc:FindFirstChild'Left Leg'
  241. local RLeg = pc:FindFirstChild'Right Leg'
  242. local torso = pc:FindFirstChild'Torso'
  243. local head = pc:FindFirstChild'Head'
  244.  
  245.  
  246. local LUA = pc:FindFirstChild'LeftUpperArm'
  247. local LLA = pc:FindFirstChild'LeftLowerArm'
  248. local LH = pc:FindFirstChild'LeftHand'
  249.  
  250. local RUA = pc:FindFirstChild'RightUpperArm'
  251. local RLA = pc:FindFirstChild'RightLowerArm'
  252. local RH = pc:FindFirstChild'RightHand'
  253.  
  254. local LUL = pc:FindFirstChild'LeftUpperLeg'
  255. local LLL = pc:FindFirstChild'LeftLowerLeg'
  256. local LF = pc:FindFirstChild'LeftFoot'
  257.  
  258. local RUL = pc:FindFirstChild'RightUpperLeg'
  259. local RLL = pc:FindFirstChild'RightLowerLeg'
  260. local RF = pc:FindFirstChild'RightFoot'
  261.  
  262. local UT = pc:FindFirstChild'UpperTorso'
  263. local LT = pc:FindFirstChild'LowerTorso'
  264.  
  265. if hum and LArm and RArm and LLeg and RLeg and head then
  266. hum.BreakJointsOnDeath = false
  267. if insta then
  268. if hum.RigType==Enum.HumanoidRigType.R6 then
  269. for _,v in pairs(torso:GetDescendants()) do
  270. if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  271. if not kill then
  272. table.insert(js2,1,{obj = v,par = v.Parent})
  273. v.Parent = nil
  274. elseif kill then
  275. v:Destroy()
  276. end
  277. end
  278. end
  279. local vis = false
  280. local vis2 = false
  281. if LArm and not LArm:FindFirstChild('Dismembered') then
  282. local at1 = Instance.new("Attachment")
  283. at1.Parent = torso
  284. at1.Visible = vis
  285. at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  286. at1.Position = Vector3.new(-1,1,0)
  287.  
  288. local at1p2 = Instance.new("Attachment")
  289. at1p2.Parent = LArm
  290. at1p2.Visible = vis
  291. at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  292. at1p2.Position = Vector3.new(.5,1,0)
  293.  
  294. local bis = Instance.new("BallSocketConstraint")
  295. bis.Parent = LArm
  296. bis.Attachment0 = at1
  297. bis.Attachment1 = at1p2
  298. bis.LimitsEnabled = true
  299. bis.UpperAngle = 15
  300. bis.Visible = vis2
  301. bis.TwistLimitsEnabled = true
  302. bis.UpperAngle = -45
  303. bis.TwistLowerAngle = -45
  304. table.insert(js,1,bis)
  305. end
  306. if RArm and not RArm:FindFirstChild('Dismembered') then
  307. local at2 = Instance.new("Attachment")
  308. at2.Parent = torso
  309. at2.Visible = vis
  310. at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  311. at2.Position = Vector3.new(1,1,0)
  312.  
  313. local at2p2 = Instance.new("Attachment")
  314. at2p2.Parent = RArm
  315. at2p2.Visible = vis
  316. at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  317. at2p2.Position = Vector3.new(-.5,1,0)
  318.  
  319. local bis2 = Instance.new("BallSocketConstraint")
  320. bis2.Parent = RArm
  321. bis2.Attachment0 = at2
  322. bis2.Attachment1 = at2p2
  323. bis2.LimitsEnabled = true
  324. bis2.UpperAngle = 15
  325. bis2.Visible = vis2
  326. bis2.TwistLimitsEnabled = true
  327. bis2.UpperAngle = -45
  328. bis2.TwistLowerAngle = -45
  329. table.insert(js,1,bis2)
  330. end
  331. if RLeg and not RLeg:FindFirstChild('Dismembered') then
  332. local at3 = Instance.new("Attachment")
  333. at3.Parent = torso
  334. at3.Visible = vis
  335. at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  336. at3.Position = Vector3.new(.5,-1,0)
  337.  
  338. local at3p2 = Instance.new("Attachment")
  339. at3p2.Parent = RLeg
  340. at3p2.Visible = vis
  341. at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  342. at3p2.Position = Vector3.new(0,1,0)
  343.  
  344. local bis3 = Instance.new("BallSocketConstraint")
  345. bis3.Parent = RLeg
  346. bis3.Attachment0 = at3
  347. bis3.Attachment1 = at3p2
  348. bis3.LimitsEnabled = true
  349. bis3.UpperAngle = 180-15
  350. bis3.Visible = vis2
  351. table.insert(js,1,bis3)
  352. end
  353.  
  354. if LLeg and not LLeg:FindFirstChild('Dismembered') then
  355. local at4 = Instance.new("Attachment")
  356. at4.Parent = torso
  357. at4.Visible = vis
  358. at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  359. at4.Position = Vector3.new(-.5,-1,0)
  360.  
  361. local at4p2 = Instance.new("Attachment")
  362. at4p2.Parent = LLeg
  363. at4p2.Visible = vis
  364. at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  365. at4p2.Position = Vector3.new(0,1,0)
  366.  
  367. local bis4 = Instance.new("BallSocketConstraint")
  368. bis4.Parent = LLeg
  369. bis4.Attachment0 = at4
  370. bis4.Attachment1 = at4p2
  371. bis4.LimitsEnabled = true
  372. bis4.UpperAngle = 180-15
  373. bis4.Visible = vis2
  374. table.insert(js,1,bis4)
  375. end
  376.  
  377. if head and not headless and not head:FindFirstChild('Dismembered') then
  378. local at5 = Instance.new("Attachment")
  379. at5.Parent = torso
  380. at5.Visible = vis
  381. at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  382. at5.Position = Vector3.new(0,1,0)
  383.  
  384. local at5p2 = Instance.new("Attachment")
  385. at5p2.Parent = head
  386. at5p2.Visible = vis
  387. at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  388. at5p2.Position = Vector3.new(0,-.5,0)
  389.  
  390. local bis5 = Instance.new("BallSocketConstraint")
  391. bis5.Parent = head
  392. bis5.Attachment0 = at5p2
  393. bis5.Attachment1 = at5
  394. bis5.LimitsEnabled = true
  395. bis5.UpperAngle = 75
  396. bis5.Visible = vis2
  397. bis5.TwistLimitsEnabled = true
  398. bis5.UpperAngle = -45
  399. bis5.TwistLowerAngle = -45
  400. table.insert(js,1,bis5)
  401. else
  402. --head:BreakJoints()
  403. end
  404. end
  405. else
  406. hum.Died:Connect(function()
  407. if hum.RigType==Enum.HumanoidRigType.R6 then
  408. for _,v in pairs(torso:GetDescendants()) do
  409. if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  410. if not kill then
  411. table.insert(js2,1,{obj = v,par = v.Parent})
  412. v.Parent = nil
  413. elseif kill then
  414. v:Destroy()
  415. end
  416. end
  417. end
  418. local vis = false
  419. local vis2 = false
  420. if LArm and not LArm:FindFirstChild('Dismembered') then
  421. local at1 = Instance.new("Attachment")
  422. at1.Parent = torso
  423. at1.Visible = vis
  424. at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  425. at1.Position = Vector3.new(-1,1,0)
  426.  
  427. local at1p2 = Instance.new("Attachment")
  428. at1p2.Parent = LArm
  429. at1p2.Visible = vis
  430. at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  431. at1p2.Position = Vector3.new(.5,1,0)
  432.  
  433. local bis = Instance.new("BallSocketConstraint")
  434. bis.Parent = LArm
  435. bis.Attachment0 = at1
  436. bis.Attachment1 = at1p2
  437. bis.LimitsEnabled = true
  438. bis.UpperAngle = 15
  439. bis.Visible = vis2
  440. bis.TwistLimitsEnabled = true
  441. bis.UpperAngle = -45
  442. bis.TwistLowerAngle = -45
  443. table.insert(js,1,bis)
  444. end
  445. if RArm and not RArm:FindFirstChild('Dismembered') then
  446. local at2 = Instance.new("Attachment")
  447. at2.Parent = torso
  448. at2.Visible = vis
  449. at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  450. at2.Position = Vector3.new(1,1,0)
  451.  
  452. local at2p2 = Instance.new("Attachment")
  453. at2p2.Parent = RArm
  454. at2p2.Visible = vis
  455. at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  456. at2p2.Position = Vector3.new(-.5,1,0)
  457.  
  458. local bis2 = Instance.new("BallSocketConstraint")
  459. bis2.Parent = RArm
  460. bis2.Attachment0 = at2
  461. bis2.Attachment1 = at2p2
  462. bis2.LimitsEnabled = true
  463. bis2.UpperAngle = 15
  464. bis2.Visible = vis2
  465. bis2.TwistLimitsEnabled = true
  466. bis2.UpperAngle = -45
  467. bis2.TwistLowerAngle = -45
  468. table.insert(js,1,bis2)
  469. end
  470. if RLeg and not RLeg:FindFirstChild('Dismembered') then
  471. local at3 = Instance.new("Attachment")
  472. at3.Parent = torso
  473. at3.Visible = vis
  474. at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  475. at3.Position = Vector3.new(.5,-1,0)
  476.  
  477. local at3p2 = Instance.new("Attachment")
  478. at3p2.Parent = RLeg
  479. at3p2.Visible = vis
  480. at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  481. at3p2.Position = Vector3.new(0,1,0)
  482.  
  483. local bis3 = Instance.new("BallSocketConstraint")
  484. bis3.Parent = RLeg
  485. bis3.Attachment0 = at3
  486. bis3.Attachment1 = at3p2
  487. bis3.LimitsEnabled = true
  488. bis3.UpperAngle = 180-15
  489. bis3.Visible = vis2
  490. table.insert(js,1,bis3)
  491. end
  492.  
  493. if LLeg and not LLeg:FindFirstChild('Dismembered') then
  494. local at4 = Instance.new("Attachment")
  495. at4.Parent = torso
  496. at4.Visible = vis
  497. at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  498. at4.Position = Vector3.new(-.5,-1,0)
  499.  
  500. local at4p2 = Instance.new("Attachment")
  501. at4p2.Parent = LLeg
  502. at4p2.Visible = vis
  503. at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  504. at4p2.Position = Vector3.new(0,1,0)
  505.  
  506. local bis4 = Instance.new("BallSocketConstraint")
  507. bis4.Parent = LLeg
  508. bis4.Attachment0 = at4
  509. bis4.Attachment1 = at4p2
  510. bis4.LimitsEnabled = true
  511. bis4.UpperAngle = 180-15
  512. bis4.Visible = vis2
  513. table.insert(js,1,bis4)
  514. end
  515.  
  516. if head and not headless and not head:FindFirstChild('Dismembered') then
  517. local at5 = Instance.new("Attachment")
  518. at5.Parent = torso
  519. at5.Visible = vis
  520. at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  521. at5.Position = Vector3.new(0,1,0)
  522.  
  523. local at5p2 = Instance.new("Attachment")
  524. at5p2.Parent = head
  525. at5p2.Visible = vis
  526. at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  527. at5p2.Position = Vector3.new(0,-.5,0)
  528.  
  529. local bis5 = Instance.new("BallSocketConstraint")
  530. bis5.Parent = head
  531. bis5.Attachment0 = at5p2
  532. bis5.Attachment1 = at5
  533. bis5.LimitsEnabled = true
  534. bis5.UpperAngle = 75
  535. bis5.Visible = vis2
  536. bis5.TwistLimitsEnabled = true
  537. bis5.UpperAngle = -45
  538. bis5.TwistLowerAngle = -45
  539. table.insert(js,1,bis5)
  540. else
  541. --head:BreakJoints()
  542. end
  543. end
  544. end)
  545. end
  546. elseif head and hum then
  547. hum.BreakJointsOnDeath = false
  548. if insta then
  549. if hum.RigType==Enum.HumanoidRigType.R15 then
  550. for _,v in pairs(pc:GetDescendants()) do
  551. if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  552. if not kill then
  553. table.insert(js2,1,{obj = v,par = v.Parent})
  554. v.Parent = nil
  555. elseif kill then
  556. v:Destroy()
  557. end
  558. end
  559. end
  560. local vis = false
  561. local vis2 = false
  562.  
  563. if LF and not LF:FindFirstChild('Dismembered') then
  564. local bsc1 = Instance.new("BallSocketConstraint",LF)
  565. bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  566. bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  567. table.insert(js,1,bsc1)
  568. end
  569. if LLL and not LLL:FindFirstChild('Dismembered') then
  570. local bsc2 = Instance.new("BallSocketConstraint",LLL)
  571. bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  572. bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  573. table.insert(js,1,bsc2)
  574. end
  575. if LUL and not LUL:FindFirstChild('Dismembered') then
  576. local bsc3 = Instance.new("BallSocketConstraint",LUL)
  577. bsc3.Attachment0 = LUL.LeftHipRigAttachment
  578. bsc3.Attachment1 = LT.LeftHipRigAttachment
  579. table.insert(js,1,bsc3)
  580. end
  581. if RF and not RF:FindFirstChild('Dismembered') then
  582. local bsc4 = Instance.new("BallSocketConstraint",RF)
  583. bsc4.Attachment0 = RF.RightAnkleRigAttachment
  584. bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  585. table.insert(js,1,bsc4)
  586. end
  587. if RLL and not RLL:FindFirstChild('Dismembered') then
  588. local bsc5 = Instance.new("BallSocketConstraint",RLL)
  589. bsc5.Attachment0 = RLL.RightKneeRigAttachment
  590. bsc5.Attachment1 = RUL.RightKneeRigAttachment
  591. table.insert(js,1,bsc5)
  592. end
  593. if RUL and not RUL:FindFirstChild('Dismembered') then
  594. local bsc6 = Instance.new("BallSocketConstraint",RUL)
  595. bsc6.Attachment0 = RUL.RightHipRigAttachment
  596. bsc6.Attachment1 = LT.RightHipRigAttachment
  597. table.insert(js,1,bsc6)
  598. end
  599. if LH and not LH:FindFirstChild('Dismembered') then
  600. local bsc7 = Instance.new("BallSocketConstraint",LH)
  601. bsc7.Attachment0 = LH.LeftWristRigAttachment
  602. bsc7.Attachment1 = LLA.LeftWristRigAttachment
  603. table.insert(js,1,bsc7)
  604. end
  605. if LLA and not LLA:FindFirstChild('Dismembered') then
  606. local bsc8 = Instance.new("BallSocketConstraint",LLA)
  607. bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  608. bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  609. table.insert(js,1,bsc8)
  610. end
  611. if LUA and not LUA:FindFirstChild('Dismembered') then
  612. local bsc9 = Instance.new("BallSocketConstraint",LUA)
  613. bsc9.Attachment0 = LUA.LeftShoulderAttachment
  614. bsc9.Attachment1 = UT.LeftCollarAttachment
  615. table.insert(js,1,bsc9)
  616. end
  617. if RH and not RH:FindFirstChild('Dismembered') then
  618. local bsc10 = Instance.new("BallSocketConstraint",RH)
  619. bsc10.Attachment0 = RH.RightWristRigAttachment
  620. bsc10.Attachment1 = RLA.RightWristRigAttachment
  621. table.insert(js,1,bsc10)
  622. end
  623. if RLA and not RLA:FindFirstChild('Dismembered') then
  624. local bsc11 = Instance.new("BallSocketConstraint",RLA)
  625. bsc11.Attachment0 = RLA.RightElbowRigAttachment
  626. bsc11.Attachment1 = RUA.RightElbowRigAttachment
  627. table.insert(js,1,bsc11)
  628. end
  629. if RUA and not RUA:FindFirstChild('Dismembered') then
  630. local bsc12 = Instance.new("BallSocketConstraint",RUA)
  631. bsc12.Attachment0 = RUA.RightShoulderAttachment
  632. bsc12.Attachment1 = UT.RightCollarAttachment
  633. table.insert(js,1,bsc12)
  634. end
  635. if LT and not LT:FindFirstChild('Dismembered') then
  636. local bsc13 = Instance.new("BallSocketConstraint",LT)
  637. bsc13.Attachment0 = LT.WaistRigAttachment
  638. bsc13.Attachment1 = UT.WaistRigAttachment
  639. table.insert(js,1,bsc13)
  640. end
  641. if head and not headless and not head:FindFirstChild('Dismembered') then
  642. local bsc14 = Instance.new("BallSocketConstraint",head)
  643. bsc14.Attachment0 = UT.NeckRigAttachment
  644. bsc14.Attachment1 = head.NeckRigAttachment
  645. bsc14.LimitsEnabled = true
  646. bsc14.UpperAngle = -75
  647. bsc14.TwistLimitsEnabled = true
  648. bsc14.UpperAngle = -45
  649. bsc14.TwistLowerAngle = -45
  650. table.insert(js,1,bsc14)
  651. else
  652. --head:BreakJoints()
  653. end
  654. end
  655. else
  656. hum.Died:Connect(function()
  657. if hum.RigType==Enum.HumanoidRigType.R15 then
  658. for _,v in pairs(pc:GetDescendants()) do
  659. if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  660. if not kill then
  661. table.insert(js2,1,{obj = v,par = v.Parent})
  662. v.Parent = nil
  663. elseif kill then
  664. v:Destroy()
  665. end
  666. end
  667. end
  668. local vis = false
  669. local vis2 = false
  670.  
  671. if LF and not LF:FindFirstChild('Dismembered') then
  672. local bsc1 = Instance.new("BallSocketConstraint",LF)
  673. bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  674. bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  675. table.insert(js,1,bsc1)
  676. end
  677. if LLL and not LLL:FindFirstChild('Dismembered') then
  678. local bsc2 = Instance.new("BallSocketConstraint",LLL)
  679. bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  680. bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  681. table.insert(js,1,bsc2)
  682. end
  683. if LUL and not LUL:FindFirstChild('Dismembered') then
  684. local bsc3 = Instance.new("BallSocketConstraint",LUL)
  685. bsc3.Attachment0 = LUL.LeftHipRigAttachment
  686. bsc3.Attachment1 = LT.LeftHipRigAttachment
  687. table.insert(js,1,bsc3)
  688. end
  689. if RF and not RF:FindFirstChild('Dismembered') then
  690. local bsc4 = Instance.new("BallSocketConstraint",RF)
  691. bsc4.Attachment0 = RF.RightAnkleRigAttachment
  692. bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  693. table.insert(js,1,bsc4)
  694. end
  695. if RLL and not RLL:FindFirstChild('Dismembered') then
  696. local bsc5 = Instance.new("BallSocketConstraint",RLL)
  697. bsc5.Attachment0 = RLL.RightKneeRigAttachment
  698. bsc5.Attachment1 = RUL.RightKneeRigAttachment
  699. table.insert(js,1,bsc5)
  700. end
  701. if RUL and not RUL:FindFirstChild('Dismembered') then
  702. local bsc6 = Instance.new("BallSocketConstraint",RUL)
  703. bsc6.Attachment0 = RUL.RightHipRigAttachment
  704. bsc6.Attachment1 = LT.RightHipRigAttachment
  705. table.insert(js,1,bsc6)
  706. end
  707. if LH and not LH:FindFirstChild('Dismembered') then
  708. local bsc7 = Instance.new("BallSocketConstraint",LH)
  709. bsc7.Attachment0 = LH.LeftWristRigAttachment
  710. bsc7.Attachment1 = LLA.LeftWristRigAttachment
  711. table.insert(js,1,bsc7)
  712. end
  713. if LLA and not LLA:FindFirstChild('Dismembered') then
  714. local bsc8 = Instance.new("BallSocketConstraint",LLA)
  715. bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  716. bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  717. table.insert(js,1,bsc8)
  718. end
  719. if LUA and not LUA:FindFirstChild('Dismembered') then
  720. local bsc9 = Instance.new("BallSocketConstraint",LUA)
  721. bsc9.Attachment0 = LUA.LeftShoulderAttachment
  722. bsc9.Attachment1 = UT.LeftCollarAttachment
  723. table.insert(js,1,bsc9)
  724. end
  725. if RH and not RH:FindFirstChild('Dismembered') then
  726. local bsc10 = Instance.new("BallSocketConstraint",RH)
  727. bsc10.Attachment0 = RH.RightWristRigAttachment
  728. bsc10.Attachment1 = RLA.RightWristRigAttachment
  729. table.insert(js,1,bsc10)
  730. end
  731. if RLA and not RLA:FindFirstChild('Dismembered') then
  732. local bsc11 = Instance.new("BallSocketConstraint",RLA)
  733. bsc11.Attachment0 = RLA.RightElbowRigAttachment
  734. bsc11.Attachment1 = RUA.RightElbowRigAttachment
  735. table.insert(js,1,bsc11)
  736. end
  737. if RUA and not RUA:FindFirstChild('Dismembered') then
  738. local bsc12 = Instance.new("BallSocketConstraint",RUA)
  739. bsc12.Attachment0 = RUA.RightShoulderAttachment
  740. bsc12.Attachment1 = UT.RightCollarAttachment
  741. table.insert(js,1,bsc12)
  742. end
  743. if LT and not LT:FindFirstChild('Dismembered') then
  744. local bsc13 = Instance.new("BallSocketConstraint",LT)
  745. bsc13.Attachment0 = LT.WaistRigAttachment
  746. bsc13.Attachment1 = UT.WaistRigAttachment
  747. table.insert(js,1,bsc13)
  748. end
  749. if head and not headless and not head:FindFirstChild('Dismembered') then
  750. local bsc14 = Instance.new("BallSocketConstraint",head)
  751. bsc14.Attachment0 = UT.NeckRigAttachment
  752. bsc14.Attachment1 = head.NeckRigAttachment
  753. bsc14.LimitsEnabled = true
  754. bsc14.UpperAngle = -75
  755. bsc14.TwistLimitsEnabled = true
  756. bsc14.UpperAngle = -45
  757. bsc14.TwistLowerAngle = -45
  758. table.insert(js,1,bsc14)
  759. else
  760. --head:BreakJoints()
  761. end
  762. end
  763. end)
  764. end
  765. end
  766. end
  767. return js,js2
  768. end
  769. function kill(obj,headshot,lookVector)
  770. local targchar,targhead,targtorso,targhum,killval
  771. pcall(function()
  772. targchar = obj.Parent
  773. end)
  774. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  775. if v and v.Character and obj:IsDescendantOf(v.Character) then
  776. targchar = v.Character
  777. end
  778. end
  779. pcall(function()
  780. targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
  781. end)
  782. pcall(function()
  783. targhead = targchar:FindFirstChild("Head")
  784. end)
  785. pcall(function()
  786. targhum = targchar:FindFirstChildOfClass("Humanoid")
  787. end)
  788. pcall(function()
  789. killval = targhum:FindFirstChild("killer")
  790. end)
  791. pcall(function()
  792. decapval = targhum:FindFirstChild("decapped " .. targchar.Name)
  793. end)
  794. if targchar and targhead and targtorso and targhum and targhum ~= hum and using then
  795. targhum:TakeDamage(1/0)
  796. if 0 >= targhum.Health then
  797. if (not decapval and headshot) or not killval then
  798. if not killval then
  799. local tempkillval = Instance.new("ObjectValue",targhum)
  800. tempkillval.Name = "killer"
  801. tempkillval.Value = plr
  802. end
  803. local kb = 15
  804. local bv = Instance.new("BodyVelocity")
  805. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  806. bv.Velocity = lookVector*kb+Vector3.new(0,kb,0)
  807. bv.Parent = targtorso
  808. game:GetService("Debris"):AddItem(bv,0.1)
  809. local ragval = Instance.new("ObjectValue")
  810. ragval.Name = 'Ragdolled'
  811. ragval.Parent = targhum
  812. Ragdoll(targchar,headshot,true,true)
  813. --bleed2(targtorso,targhum,true,5,true)
  814. end
  815. if headshot and not decapval then
  816. local tempdecapval = Instance.new("ObjectValue",targhum)
  817. tempdecapval.Name = ("decapped " .. targchar.Name)
  818. --[[
  819. local decap_bleed = Instance.new("Sound")
  820. decap_bleed.SoundId = 'rbxassetid://244502094'
  821. decap_bleed.Volume = 0.5
  822. decap_bleed.Parent = targtorso
  823. decap_bleed:Play()
  824. local decap_head = Instance.new("Sound")
  825. decap_head.SoundId = 'rbxassetid://1255040462' --222406108
  826. decap_head.Volume = 1
  827. decap_head.Parent = targtorso
  828. decap_head:Play()
  829. ]]
  830. remote:FireClient(plr,1,'rbxassetid://244502094',nil,0.5,targtorso)
  831. remote:FireClient(plr,1,'rbxassetid://1255040462',nil,1,targtorso)
  832. local att = Instance.new("Attachment")
  833. att.Parent = targtorso
  834. att.Position = Vector3.new(0,targtorso.Size.Y/2,0)
  835. local blood_emitter = Instance.new("ParticleEmitter")
  836. blood_emitter.Name = "Blood2"
  837. blood_emitter.Parent = att
  838. blood_emitter.Speed = NumberRange.new(5, 14)
  839. blood_emitter.Color = ColorSequence.new(Color3.new(0.45098, 0, 0),Color3.new(0.45098, 0, 0))
  840. blood_emitter.LightEmission = 0.20000000298023
  841. blood_emitter.LightInfluence = 1
  842. blood_emitter.Texture = "http://www.roblox.com/asset/?id=134531274"
  843. blood_emitter.Transparency = NumberSequence.new(0.30000001192093,0.30000001192093)
  844. blood_emitter.ZOffset = 0
  845. blood_emitter.Size = NumberSequence.new(0.12499988079071,0)
  846. blood_emitter.Acceleration = Vector3.new(0, -20, 0)
  847. blood_emitter.Lifetime = NumberRange.new(0.5, 1.5)
  848. blood_emitter.Rate = 100000
  849. blood_emitter.SpreadAngle = Vector2.new(90, 90)
  850. blood_emitter.VelocitySpread = 90
  851. blood_emitter.Enabled = true
  852. spawn(function()
  853. wait(5)
  854. blood_emitter.Enabled = false
  855. game:GetService("Debris"):AddItem(blood_emitter,2)
  856. end)
  857. end
  858. end
  859. end
  860. end
  861. function bleed2(frick,targhum,can_hurt,t,splat)
  862. --spawn(function()
  863. if not frick:FindFirstChild("bleeding from kry's " .. gun.Name) then else return end
  864. local tempbleedval = Instance.new("ObjectValue")
  865. tempbleedval.Name = "bleeding from kry's " .. gun.Name
  866. tempbleedval.Parent = frick
  867. local bleeding = true
  868. local rig = targhum.RigType
  869. local limbs = {'Head','Left Arm','Right Arm','Left Leg','Right Leg','RightUpperLeg','LeftUpperLeg','RightUpperArm','LeftUpperArm','RightLowerLeg','LeftLowerLeg','RightLowerArm','LeftLowerArm','RightFoot','LeftFoot','RightHand','LeftHand'}
  870. spawn(function()
  871. wait(t)
  872. bleeding = false
  873. tempbleedval:Destroy()
  874. end)
  875. while bleeding and frick and frick.Parent do
  876. if --[[(targhum and targhum.Parent and targhum.Health > 0) or]] (not frick or not frick.Parent or not targhum or not targhum.Parent) then
  877. break
  878. end
  879. local max_limbs = 0
  880. local current_limbs = 0
  881. local gone_limbs = 0
  882. local targchar = targhum.Parent
  883. if rig == Enum.HumanoidRigType.R6 then
  884. max_limbs = 5
  885. elseif rig == Enum.HumanoidRigType.R15 then
  886. max_limbs = 13
  887. end
  888. for i,v in pairs(targchar:GetChildren()) do
  889. local found = false
  890. for i,n in pairs(limbs) do if n == v.Name then found = true; end; end;
  891. if found and not v:FindFirstChild("Dismembered") then
  892. current_limbs = current_limbs + 1
  893. end
  894. end
  895. gone_limbs = (max_limbs-current_limbs)
  896. if targhum and can_hurt then
  897. if gone_limbs >= 1 then
  898. targhum:TakeDamage(0.5*gone_limbs)
  899. else
  900. targhum:TakeDamage(0.5)
  901. end
  902. end
  903. spawn(function()
  904. local thing = Instance.new('Part')
  905. thing.Parent = workspace
  906. thing.Size = Vector3.new(0.1,0.1,0.1)
  907. thing.CFrame = frick.CFrame*CFrame.new(0,frick.Size.Y/2,0)
  908. if splat then
  909. thing.Transparency = 0
  910. elseif not splat then
  911. thing.Transparency = 1
  912. end
  913. thing.Color = Color3.fromRGB(75, 0, 0)
  914. thing.Material = Enum.Material.Glass
  915. thing.Name = "blood_drop"
  916. thing.CanCollide =false
  917. thing:BreakJoints()
  918. local mesh = Instance.new('SpecialMesh')
  919. mesh.MeshType = Enum.MeshType.Sphere
  920. mesh.Parent = thing
  921. --game:GetService("Debris"):AddItem(thing,5)
  922. local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
  923. att1.Parent = thing
  924. att1.Position = Vector3.new(0,-(thing.Size.Y/2),0)
  925. att2.Parent = thing
  926. att2.Position = Vector3.new(0,(thing.Size.Y/2),0)
  927. if splat then
  928. local trail_drop = Instance.new("Trail")
  929. trail_drop.Parent = thing
  930. trail_drop.Attachment0 = att1
  931. trail_drop.Attachment1 = att2
  932. trail_drop.Color = ColorSequence.new(Color3.new(0.294118, 0, 0),Color3.new(0.294118, 0, 0))
  933. trail_drop.FaceCamera = true
  934. trail_drop.LightInfluence = 1
  935. trail_drop.Transparency = NumberSequence.new(0.1,1)
  936. trail_drop.Lifetime = 1
  937. trail_drop.MinLength = 0
  938. end
  939. local rawrxd = Instance.new('BodyForce')
  940. rawrxd.Parent = thing
  941. if splat then
  942. rawrxd.Force = frick.CFrame.upVector+Vector3.new(math.random(-5, 5)/10,3,math.random(-5, 5)/10)
  943. elseif not splat then
  944. rawrxd.Force = frick.CFrame.upVector*(math.random()*2)+Vector3.new(math.random(-5, 5)/10,1.5,0)
  945. end
  946. game:GetService("Debris"):AddItem(rawrxd,0.01)
  947. thing.Touched:connect(function(tou)
  948. if tou and tou.Parent and not tou:IsDescendantOf(targchar) and not tou.Parent:FindFirstChildOfClass("Humanoid") and not tou.Parent.Parent:FindFirstChildOfClass("Humanoid") and not tou.Parent:IsA("Accessory") and tou.Name ~= 'Handle' and tou.Parent.Name ~= 'Handle' and not tou.Parent:IsA("Tool") and not string.match(tou.Name:lower(),'blood_drop') and not string.match(tou.Name:lower(),'bullet') and not string.match(tou.Name:lower(),'bone') and not string.match(tou.Name:lower(),'gun mag') and not string.match(tou.Name:lower(),'limb') then
  949. local pos = Vector3.new(thing.Position.X,(tou.Position.Y+(tou.Size.Y/2))+(0.02/2),thing.Position.Z)
  950. local Point1 = pos-Vector3.new(0.01,0.01,0.01)
  951. local Point2 = pos+Vector3.new(0.01,0.01,0.01)
  952. local Region = Region3.new(Point1,Point2)
  953. for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
  954. if Part.Name == "blood" then
  955. tou = Part
  956. end
  957. end
  958. thing:Destroy()
  959. if tou.Name == "blood" then
  960. local reee = tou.CFrame
  961. if tou.Transparency > -0.2 then
  962. tou.Transparency = tou.Transparency - 0.1
  963. end
  964. if tou.Size.X < 5 then
  965. tou.Size = tou.Size+Vector3.new(0.4,0,0.4)
  966. tou.CFrame = reee
  967. elseif tou.Size.X < 7.5 then
  968. tou.Size = tou.Size+Vector3.new(0.3,0,0.3)
  969. tou.CFrame = reee
  970. elseif tou.Size.X < 10 then
  971. tou.Size = tou.Size+Vector3.new(0.2,0,0.2)
  972. tou.CFrame = reee
  973. end
  974. elseif tou.CanCollide == true then
  975. local bloodlol = Instance.new('Part')
  976. if gone_limbs >= 1 then
  977. bloodlol.Size = Vector3.new(1*gone_limbs,0.2,1*gone_limbs)
  978. else
  979. bloodlol.Size = Vector3.new(1,0.2,1)
  980. end
  981. bloodlol.Name = "blood"
  982. bloodlol.Anchored = true
  983. bloodlol.CanCollide = false
  984. bloodlol.Material = Enum.Material.Glass
  985. bloodlol.Color = Color3.fromRGB(75, 0, 0)
  986. local mesh = Instance.new('SpecialMesh')
  987. mesh.MeshType = Enum.MeshType.Sphere
  988. mesh.Parent = bloodlol
  989. bloodlol.Parent = workspace
  990. bloodlol.CFrame = CFrame.new(pos)
  991. while bloodlol and bloodlol.Parent ~= nil do
  992. if bloodlol.Transparency < 1 then
  993. bloodlol.Transparency = bloodlol.Transparency + 0.05
  994. else
  995. bloodlol:Destroy()
  996. end
  997. wait(0.1)
  998. end
  999. end
  1000. end
  1001. end)
  1002. end)
  1003. wait(0.1)
  1004. end
  1005. tempbleedval:Destroy()
  1006. --end)
  1007. end
  1008.  
  1009. function Reload()
  1010. if max_ammo > ammo then else return end
  1011. using = true
  1012. reload_s:Play()
  1013. local mag = Instance.new("Part")
  1014. mag.Name = 'gun mag'
  1015. mag.Size = Vector3.new(0.53, 0.94, 0.23)
  1016. mag.Color = han.Color
  1017. mag.Parent = workspace
  1018. mag.CFrame = han.CFrame * CFrame.new(0.7,0,0)
  1019. debris:AddItem(mag,10)
  1020. repeat wait() until not reload_s.IsPlaying
  1021. ammo = max_ammo
  1022. game:GetService("Debris"):AddItem(mag,10)
  1023. using = false
  1024. end
  1025.  
  1026. function breakwindow(hit)
  1027. if hit and not string.match(hit.Name:lower(),"window shatter") and not string.match(hit.Name:lower(),"blood") then else return end
  1028. local wbreakc = wbreak:Clone()
  1029. wbreakc.Parent = hit
  1030. wbreakc:Play()
  1031. local sx,sy,sz=hit.Size.x,hit.Size.y,hit.Size.z
  1032. hit.Name = "window shatter"
  1033. for x=1,4 do
  1034. for y=1,4 do
  1035. local part=hit:Clone()
  1036. local position=Vector3.new(x-2.1,y-2.1,0)*Vector3.new(sx/4,sy/4,sz)
  1037. part.Size=Vector3.new(sx/4,sy/4,sz)
  1038. part.CFrame=hit.CFrame*(CFrame.new(part.Size/8)-hit.Size/8+position)
  1039. part.Velocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  1040. part.Name="window shatter"
  1041. part.Parent=hit.Parent
  1042. debris:AddItem(part,2)
  1043. spawn(function()
  1044. wait(0.5)
  1045. for i=1,10 do
  1046. part.Transparency=part.Transparency+0.05
  1047. wait(0.05)
  1048. end
  1049. part:Destroy()
  1050. end)
  1051. part.Anchored=false
  1052. end
  1053. end
  1054. hit:Destroy()
  1055. end
  1056.  
  1057. function raycast(Pos,Dir,Max,Ignore)
  1058. return workspace:FindPartOnRayWithIgnoreList(Ray.new(Pos, Dir * (Max or 999.999)), (Ignore or {}), false, true)
  1059. end
  1060.  
  1061. local objhit = {}
  1062. local oldobjhit = {}
  1063.  
  1064. function make_hole(pos,obj,col)
  1065. local BulletHolePart = Instance.new("Part")
  1066. BulletHolePart.Massless = true
  1067. BulletHolePart.Anchored = false
  1068. BulletHolePart.CanCollide = false
  1069. BulletHolePart.Locked = true
  1070. BulletHolePart.FormFactor = "Custom"
  1071. BulletHolePart.TopSurface, BulletHolePart.BottomSurface, BulletHolePart.RightSurface, BulletHolePart.LeftSurface, BulletHolePart.FrontSurface, BulletHolePart.BackSurface = "SmoothNoOutlines", "SmoothNoOutlines", "SmoothNoOutlines", "SmoothNoOutlines", "SmoothNoOutlines", "SmoothNoOutlines"
  1072. BulletHolePart.Name = "Bullet Hole"
  1073. BulletHolePart.Material = "Plastic"
  1074. BulletHolePart.Reflectance = 0
  1075. BulletHolePart.Transparency = 1
  1076. BulletHolePart.BrickColor = BrickColor.new("Medium stone grey")
  1077. BulletHolePart.Size = Vector3.new(0.3, 0, 0.3)
  1078. BulletHolePart:BreakJoints()
  1079. BulletHolePart.CFrame = pos
  1080. BulletHolePart.Parent = script
  1081. local weld = Instance.new("WeldConstraint")
  1082. weld.Part0 = obj
  1083. weld.Part1 = BulletHolePart
  1084. weld.Parent = obj
  1085. -- game:GetService("Debris"):AddItem(BulletHolePart, 5)
  1086. --[[
  1087. local BulletHoleDecal = Instance.new("Decal")
  1088. BulletHoleDecal.Color3 = Color3.new(col.r, col.g, col.b)
  1089. BulletHoleDecal.Face = "Top"
  1090. BulletHoleDecal.Texture = "rbxassetid://359667865"
  1091. BulletHoleDecal.Transparency = 0
  1092. BulletHoleDecal.Parent = BulletHolePart
  1093. ]]
  1094. remote:FireClient(plr,2,"rbxassetid://359667865","Top",0,BulletHolePart)
  1095. return BulletHolePart
  1096. end
  1097.  
  1098. local blood_images = {931617584,1663434319,1391189545,4533673847,3236192667,2565888666,612591729,120362139,116830967,122022304,131339257,247766282,121678640,176677800,120361912,176678070,176678086,176677869} --305296807,256293532,148713503,176678030
  1099.  
  1100. local e_s = 1
  1101.  
  1102. function add_decal(f,t,obj)
  1103. --spawn(function()
  1104. local texture = Instance.new("Texture")
  1105. texture.Parent = obj
  1106. texture.Face = f
  1107. texture.Texture = 'rbxassetid://' .. t
  1108. if f == 'Left' or f == 'Right' then
  1109. texture.StudsPerTileV = obj.Size.Y + e_s
  1110. if (obj.Size.X > obj.Size.Z) then
  1111. texture.StudsPerTileV = obj.Size.Z + e_s
  1112. elseif (obj.Size.Z > obj.Size.X) then
  1113. texture.StudsPerTileU = obj.Size.X + e_s
  1114. else
  1115. texture.StudsPerTileU = obj.Size.X + e_s
  1116. end
  1117. elseif f == 'Front' or f == 'Back' then
  1118. texture.StudsPerTileV = obj.Size.Y + e_s
  1119. if (obj.Size.X > obj.Size.Z) then
  1120. texture.StudsPerTileV = obj.Size.X + e_s
  1121. elseif (obj.Size.Z > obj.Size.X) then
  1122. texture.StudsPerTileU = obj.Size.Z + e_s
  1123. else
  1124. texture.StudsPerTileU = obj.Size.X + e_s
  1125. end
  1126. elseif f == 'Top' or f == 'Bottom' then
  1127. texture.StudsPerTileV = obj.Size.X + e_s
  1128. texture.StudsPerTileU = obj.Size.Z + e_s
  1129. end
  1130. --end)
  1131. end
  1132.  
  1133. function add_blood(obj)
  1134. local t1,t2,t3,t4,t5,t6 = blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)]
  1135. add_decal('Top',t1,obj)
  1136. add_decal('Bottom',t2,obj)
  1137. add_decal('Left',t3,obj)
  1138. add_decal('Right',t4,obj)
  1139. add_decal('Front',t5,obj)
  1140. add_decal('Back',t6,obj)
  1141. end
  1142.  
  1143. function make_bone(obj,targtorso)
  1144. if obj.Name == 'Left Arm' or obj.Name == 'LeftUpperArm' then
  1145. local bone = Instance.new("Part")
  1146. bone.name = 'bone'
  1147. bone.CanCollide = false
  1148. bone.Anchored = false
  1149. bone.CFrame = targtorso.CFrame
  1150. bone.Size = targtorso.Size
  1151. bone.Massless = true
  1152. bone.Locked = true
  1153. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1154. if not exists then
  1155. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1156. end
  1157. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1158. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1159. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1160. local weld = Instance.new("Weld")
  1161. weld.Part0 = bone
  1162. weld.Part1 = targtorso
  1163. weld.C1 = CFrame.new(-0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(90))
  1164. weld.Parent = bone
  1165. targtorso.Anchored = false
  1166. bone.Parent = script
  1167. local mesh = Instance.new("SpecialMesh")
  1168. mesh.MeshId = 'rbxassetid://1076136382'
  1169. mesh.TextureId = 'rbxassetid://1076137938'
  1170. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1171. mesh.Parent = bone
  1172. --
  1173. local bone = Instance.new("Part")
  1174. bone.Name = 'bone'
  1175. bone.CanCollide = false
  1176. bone.Anchored = false
  1177. bone.CFrame = obj.CFrame
  1178. bone.Size = obj.Size
  1179. bone.Massless = true
  1180. bone.Locked = true
  1181. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1182. if not exists then
  1183. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1184. end
  1185. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1186. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1187. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1188. local weld = Instance.new("Weld")
  1189. weld.Part0 = bone
  1190. weld.Part1 = obj
  1191. weld.C1 = CFrame.new(0.13,0.26,0)
  1192. weld.Parent = bone
  1193. obj.Anchored = false
  1194. bone.Parent = script
  1195. local mesh = Instance.new("SpecialMesh")
  1196. mesh.MeshId = 'rbxassetid://36780032'
  1197. mesh.TextureId = 'rbxassetid://36780292'
  1198. mesh.Parent = bone
  1199. elseif obj.Name == 'Right Arm' or obj.Name == 'RightUpperArm' then
  1200. local bone = Instance.new("Part")
  1201. bone.Name = 'bone'
  1202. bone.CanCollide = false
  1203. bone.Anchored = false
  1204. bone.CFrame = targtorso.CFrame
  1205. bone.Size = targtorso.Size
  1206. bone.Massless = true
  1207. bone.Locked = true
  1208. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1209. if not exists then
  1210. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1211. end
  1212. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1213. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1214. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1215. local weld = Instance.new("Weld")
  1216. weld.Part0 = bone
  1217. weld.Part1 = targtorso
  1218. weld.C1 = CFrame.new(0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(-90))
  1219. weld.Parent = bone
  1220. targtorso.Anchored = false
  1221. bone.Parent = script
  1222. local mesh = Instance.new("SpecialMesh")
  1223. mesh.MeshId = 'rbxassetid://1076136382'
  1224. mesh.TextureId = 'rbxassetid://1076137938'
  1225. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1226. mesh.Parent = bone
  1227. --
  1228. local bone = Instance.new("Part")
  1229. bone.Name = 'bone'
  1230. bone.CanCollide = false
  1231. bone.Anchored = false
  1232. bone.CFrame = obj.CFrame
  1233. bone.Size = obj.Size
  1234. bone.Massless = true
  1235. bone.Locked = true
  1236. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1237. if not exists then
  1238. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1239. end
  1240. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1241. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1242. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1243. local weld = Instance.new("Weld")
  1244. weld.Part0 = bone
  1245. weld.Part1 = obj
  1246. weld.C1 = CFrame.new(-0.13,0.26,0)
  1247. weld.Parent = bone
  1248. obj.Anchored = false
  1249. bone.Parent = script
  1250. local mesh = Instance.new("SpecialMesh")
  1251. mesh.MeshId = 'rbxassetid://36780156'
  1252. mesh.TextureId = 'rbxassetid://36780292'
  1253. mesh.Parent = bone
  1254. elseif obj.Name == 'Left Leg' or obj.Name == 'LeftUpperLeg' then
  1255. local bone = Instance.new("Part")
  1256. bone.Name = 'bone'
  1257. bone.CanCollide = false
  1258. bone.Anchored = false
  1259. bone.CFrame = targtorso.CFrame
  1260. bone.Size = targtorso.Size
  1261. bone.Massless = true
  1262. bone.Locked = true
  1263. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1264. if not exists then
  1265. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1266. end
  1267. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1268. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1269. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1270. local weld = Instance.new("Weld")
  1271. weld.Part0 = bone
  1272. weld.Part1 = targtorso
  1273. weld.C1 = CFrame.new(-0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  1274. weld.Parent = bone
  1275. targtorso.Anchored = false
  1276. bone.Parent = script
  1277. local mesh = Instance.new("SpecialMesh")
  1278. mesh.MeshId = 'rbxassetid://1076136382'
  1279. mesh.TextureId = 'rbxassetid://1076137938'
  1280. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1281. mesh.Parent = bone
  1282. --
  1283. local bone = Instance.new("Part")
  1284. bone.Name = 'bone'
  1285. bone.CanCollide = false
  1286. bone.Anchored = false
  1287. bone.CFrame = obj.CFrame
  1288. bone.Size = obj.Size
  1289. bone.Massless = true
  1290. bone.Locked = true
  1291. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1292. if not exists then
  1293. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1294. end
  1295. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1296. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1297. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1298. local weld = Instance.new("Weld")
  1299. weld.Part0 = bone
  1300. weld.Part1 = obj
  1301. weld.C1 = CFrame.new(0,0.09,0.13)
  1302. weld.Parent = bone
  1303. obj.Anchored = false
  1304. bone.Parent = script
  1305. local mesh = Instance.new("SpecialMesh")
  1306. mesh.MeshId = 'rbxassetid://36780156'
  1307. mesh.TextureId = 'rbxassetid://36780292'
  1308. mesh.Parent = bone
  1309. elseif obj.Name == 'Right Leg' or obj.Name == 'RightUpperLeg' then
  1310. local bone = Instance.new("Part")
  1311. bone.Name = 'bone'
  1312. bone.CanCollide = false
  1313. bone.Anchored = false
  1314. bone.CFrame = targtorso.CFrame
  1315. bone.Size = targtorso.Size
  1316. bone.Massless = true
  1317. bone.Locked = true
  1318. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1319. if not exists then
  1320. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1321. end
  1322. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1323. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1324. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1325. local weld = Instance.new("Weld")
  1326. weld.Part0 = bone
  1327. weld.Part1 = targtorso
  1328. weld.C1 = CFrame.new(0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  1329. weld.Parent = bone
  1330. targtorso.Anchored = false
  1331. bone.Parent = script
  1332. local mesh = Instance.new("SpecialMesh")
  1333. mesh.MeshId = 'rbxassetid://1076136382'
  1334. mesh.TextureId = 'rbxassetid://1076137938'
  1335. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1336. mesh.Parent = bone
  1337. --
  1338. local bone = Instance.new("Part")
  1339. bone.Name = 'bone'
  1340. bone.CanCollide = false
  1341. bone.Anchored = false
  1342. bone.CFrame = obj.CFrame
  1343. bone.Size = obj.Size
  1344. bone.Massless = true
  1345. bone.Locked = true
  1346. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1347. if not exists then
  1348. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1349. end
  1350. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1351. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1352. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1353. local weld = Instance.new("Weld")
  1354. weld.Part0 = bone
  1355. weld.Part1 = obj
  1356. weld.C1 = CFrame.new(0,0.09,0.13)
  1357. weld.Parent = bone
  1358. obj.Anchored = false
  1359. bone.Parent = script
  1360. local mesh = Instance.new("SpecialMesh")
  1361. mesh.MeshId = 'rbxassetid://36780195'
  1362. mesh.TextureId = 'rbxassetid://36780292'
  1363. mesh.Parent = bone
  1364. elseif obj.Name == 'Head' then
  1365. local bone = Instance.new("Part")
  1366. bone.Name = 'bone'
  1367. bone.CanCollide = false
  1368. bone.Anchored = false
  1369. bone.CFrame = targtorso.CFrame
  1370. bone.Size = targtorso.Size
  1371. bone.Massless = true
  1372. bone.Locked = true
  1373. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1374. if not exists then
  1375. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1376. end
  1377. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1378. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1379. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1380. local weld = Instance.new("Weld")
  1381. weld.Part0 = bone
  1382. weld.Part1 = targtorso
  1383. weld.C1 = CFrame.new(0,0.66,0)
  1384. weld.Parent = bone
  1385. targtorso.Anchored = false
  1386. bone.Parent = script
  1387. local mesh = Instance.new("SpecialMesh")
  1388. mesh.MeshId = 'rbxassetid://1076136382'
  1389. mesh.TextureId = 'rbxassetid://1076137938'
  1390. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1391. mesh.Parent = bone
  1392. --
  1393. local bone = Instance.new("Part")
  1394. bone.Name = 'bone'
  1395. bone.CanCollide = false
  1396. bone.Anchored = false
  1397. bone.CFrame = obj.CFrame
  1398. bone.Size = obj.Size
  1399. bone.Massless = true
  1400. bone.Locked = true
  1401. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1402. if not exists then
  1403. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1404. end
  1405. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1406. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1407. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1408. local weld = Instance.new("Weld")
  1409. weld.Part0 = bone
  1410. weld.Part1 = obj
  1411. weld.C1 = CFrame.new(0,-0.23,0)*CFrame.Angles(0,math.rad(-90),0)
  1412. weld.Parent = bone
  1413. obj.Anchored = false
  1414. bone.Parent = script
  1415. local mesh = Instance.new("SpecialMesh")
  1416. mesh.MeshId = 'rbxassetid://1076136382'
  1417. mesh.TextureId = 'rbxassetid://1076137938'
  1418. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1419. mesh.Parent = bone
  1420. end
  1421. end
  1422.  
  1423. function break_limb(obj,rig,targtorso,targhum)
  1424. if not obj:FindFirstChild('Dismembered') and obj.Name ~= 'Torso' and obj.Name ~= 'HumanoidRootPart' and obj.Name ~= 'UpperTorso' and obj.Name ~= 'LowerTorso' then else return end
  1425. local confirm = Instance.new("ObjectValue")
  1426. confirm.Name = 'Dismembered'
  1427. confirm.Parent = obj
  1428. local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
  1429. if bsc then
  1430. bsc:Destroy()
  1431. end
  1432. --bleed2(obj,targhum,false,5,false)
  1433. add_blood(obj)
  1434. make_bone(obj,targtorso)
  1435. local kb = 15
  1436. local bv = Instance.new("BodyVelocity")
  1437. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1438. bv.Velocity = han.CFrame.lookVector*kb+Vector3.new(0,kb,0)
  1439. bv.Parent = obj
  1440. game:GetService("Debris"):AddItem(bv,0.1)
  1441. if rig == Enum.HumanoidRigType.R6 then
  1442. local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
  1443. if bsc then
  1444. bsc:Destroy()
  1445. end
  1446. for i,v in pairs(targtorso:GetChildren()) do
  1447. if v:IsA("Motor6D") then
  1448. if obj.Name == 'Head' and v.Name == 'Neck' then
  1449. v:Destroy()
  1450. elseif obj.Name == 'Left Arm' and v.Name == 'Left Shouldver' then
  1451. v:Destroy()
  1452. elseif obj.Name == 'Right Arm' and v.Name == 'Right Shoulder' then
  1453. v:Destroy()
  1454. elseif obj.Name == 'Left Leg' and v.Name == 'Left Hip' then
  1455. if obj.Parent:FindFirstChild("Right Leg") then
  1456. targhum.WalkSpeed = targhum.WalkSpeed/2
  1457. else
  1458. targhum.WalkSpeed = 0
  1459. end
  1460. v:Destroy()
  1461. elseif obj.Name == 'Right Leg' and v.Name == 'Right Hip' then
  1462. if obj.Parent:FindFirstChild("Left Leg") then
  1463. targhum.WalkSpeed = targhum.WalkSpeed/2
  1464. else
  1465. targhum.WalkSpeed = 0
  1466. end
  1467. v:Destroy()
  1468. end
  1469. end
  1470. end
  1471. elseif rig == Enum.HumanoidRigType.R15 then
  1472. for i,v in pairs(obj:GetChildren()) do
  1473. if v:IsA("Motor6D") then
  1474. if (obj.Name == 'LeftUpperLeg' and obj.Parent:FindFirstChild("RightUpperLeg")) or (obj.Name == 'RightUpperLeg' and obj.Parent:FindFirstChild("LeftUpperLeg")) then
  1475. targhum.WalkSpeed = targhum.WalkSpeed/2
  1476. elseif obj.Name == 'RightUpperLeg' or obj.Name == 'LeftUpperLeg' then
  1477. targhum.WalkSpeed = 0
  1478. end
  1479. v:Destroy()
  1480. end
  1481. end
  1482. end
  1483. local cb = Instance.new("Part")
  1484. cb.Name = 'limb'
  1485. cb.Transparency = 1
  1486. cb.CanCollide = true
  1487. cb.Anchored = false
  1488. cb.CFrame = obj.CFrame
  1489. cb.Size = obj.Size
  1490. cb.Massless = true
  1491. cb.Locked = true
  1492. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1493. if not exists then
  1494. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1495. end
  1496. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1497. game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  1498. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1499. local weld = Instance.new("Weld")
  1500. weld.Part0 = cb
  1501. weld.Part1 = obj
  1502. weld.Parent = cb
  1503. obj.Massless = true
  1504. obj.Anchored = false
  1505. cb.Parent = script
  1506. end
  1507.  
  1508. function check(toughness,obj,objpos,p,rays,rot)
  1509. local plrhit = false
  1510. if obj and not obj:FindFirstChild('Dismembered') then else return; end;
  1511. local targchar,targtorso,targhum,targhead
  1512. pcall(function()
  1513. targchar = obj.Parent
  1514. end)
  1515. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  1516. if v and v.Character and obj:IsDescendantOf(v.Character) then
  1517. targchar = v.Character
  1518. end
  1519. end
  1520. pcall(function()
  1521. targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
  1522. end)
  1523. pcall(function()
  1524. targhum = targchar:FindFirstChildOfClass("Humanoid")
  1525. end)
  1526. pcall(function()
  1527. targhead = targchar:FindFirstChild("Head")
  1528. end)
  1529. if targchar and targchar.Parent and targtorso and targtorso.Parent and targhum and targhum.Parent and targhum ~= hum and targhead and targhead.Parent and not targhum:FindFirstChild("hit " .. targchar.Name .. " with " .. gun.Name .. " by " .. plr.Name) then
  1530. plrhit = true
  1531. local confirm = Instance.new("IntValue")
  1532. confirm.Parent = targhum
  1533. confirm.Name = ("hit " .. targchar.Name .. " with " .. gun.Name .. " by " .. plr.Name)
  1534. debris:AddItem(confirm,shootwait)
  1535. local dmg = math.random(60,70)
  1536. if obj == targhead then
  1537. dmg = math.random(100,110)
  1538. targhum:TakeDamage(dmg)
  1539. elseif not op then
  1540. dmg = math.random(60,70)
  1541. targhum:TakeDamage(dmg)
  1542. elseif op then
  1543. targhum.MaxHealth = 0
  1544. targhum.Health = 0
  1545. targhum.Parent:BreakJoints()
  1546. end
  1547. add_blood(obj)
  1548. break_limb(obj,targhum.RigType,targtorso,targhum)
  1549. --[[
  1550. local bleeding = Instance.new("Sound")
  1551. bleeding.SoundId = 'rbxassetid://360007673'
  1552. bleeding.Volume = 1
  1553. bleeding.Parent = targtorso
  1554. bleeding:Play()
  1555. ]]
  1556. remote:FireClient(plr,1,'rbxassetid://360007673',nil,1,targtorso)
  1557. if 0 >= targhum.Health and obj == targhead then
  1558. kill(obj,true,p.CFrame.lookVector)
  1559. elseif 0 >= targhum.Health then
  1560. kill(obj,false,p.CFrame.lookVector)
  1561. elseif targhum.Health > 0 then
  1562. --bleed2(targtorso,targhum,true,5,false)
  1563. end
  1564. else
  1565. table.insert(objhit,1,obj)
  1566. local mat = obj.Material
  1567. local mathit = obj:FindFirstChild('material hit ' .. plr.Name)
  1568. if not mathit and toughness > 0 and 1 > obj.Transparency then
  1569. --print('old: ' .. toughness)
  1570. if (mat == Enum.Material.Glass or mat == Enum.Material.Ice) then
  1571. breakwindow(obj)
  1572. elseif (mat == Enum.Material.Wood or mat == Enum.Material.WoodPlanks) then
  1573. toughness = toughness - 1.5
  1574. elseif (mat == Enum.Material.Metal or mat == Enum.Material.DiamondPlate or mat == Enum.Material.CorrodedMetal) then
  1575. toughness = toughness - 5
  1576. elseif (mat == Enum.Material.Brick or mat == Enum.Material.Concrete or mat == Enum.Material.Cobblestone or mat == Enum.Material.Granite or mat == Enum.Material.Slate or mat == Enum.Material.Pebble) then
  1577. toughness = toughness - 3
  1578. else
  1579. toughness = toughness - 1
  1580. end
  1581. --print('new: ' .. toughness)
  1582. local libruary = {
  1583. ['wizz'] = {342190005, 342190012, 342190017, 342190024},
  1584. ['crackSmall'] = {873119768, 873119788, 873119811, 873119845, 873119886, 873119904},
  1585. ['crackBig'] = {873119597, 873119653, 873119679, 873119703, 873119724, 873119744},
  1586. ['whizz'] = {873121840, 873121858, 873121876, 873121896, 873121913, 873121936},
  1587. ['woodhit'] = {342204157, 342204164, 342204170, 342204175, 871705143, 871705174}, --871705195, 871705217, 871705237, 871705264
  1588. ['stonehit'] = {871701076, 871701134, 871701190, 871701241, 871701297, 871701346},
  1589. ['metalhit'] = {871704182, 871704259, 871704297, 871704329, 871704362, 871704395},
  1590. ['grasshit'] = {871709869, 871709832, 871709789, 871709755, 871709708, 871709643},
  1591. ['impact'] = {525720625},
  1592. }
  1593. local soundfont=({
  1594. Brick="stonehit";
  1595. Cobblestone="stonehit";
  1596. Concrete="stonehit";
  1597. CorrodedMetal="metalhit";
  1598. DiamondPlate="metalhit";
  1599. Fabric=nil;
  1600. Foil="metalhit";
  1601. Granite="stonehit";
  1602. Grass="grasshit";
  1603. Ice="stonehit";
  1604. Marble="stonehit";
  1605. Metal="metalhit";
  1606. Neon=nil;
  1607. Pebble="stonehit";
  1608. Plastic="metalhit";
  1609. Sand=nil;
  1610. Slate="stonehit";
  1611. SmoothPlastic="metalhit";
  1612. Wood="woodhit";
  1613. WoodPlanks="woodhit";
  1614. })[mat.Name]
  1615. local part = make_hole(CFrame.new(objpos, objpos - rot) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) * CFrame.Angles(math.rad(0), math.rad(math.random(-360, 360)), math.rad(0)), obj, obj.BrickColor)
  1616. --[[
  1617. local BulletHoleSound = Instance.new("Sound")
  1618. BulletHoleSound.Volume = 3
  1619. BulletHoleSound.Pitch = math.random(9,11)/10
  1620. ]]
  1621. local _id = ''
  1622. if soundfont ~= nil then
  1623. --[[BulletHoleSound.SoundId]]_id = "rbxassetid://"..libruary[soundfont][math.random(1,6)]
  1624. else
  1625. --[[BulletHoleSound.SoundId]]_id = "rbxassetid://"..libruary['impact'][1]
  1626. end
  1627. --BulletHoleSound.Parent = part
  1628. --BulletHoleSound:Play()
  1629. remote:FireClient(plr,1,_id,nil,3,part)
  1630. local tempmathit = Instance.new("ObjectValue")
  1631. tempmathit.Name = ('material hit ' .. plr.Name)
  1632. tempmathit.Parent = obj
  1633. game:GetService("Debris"):AddItem(tempmathit,shootwait/bulletfire)
  1634. game:GetService("Debris"):AddItem(part,7)
  1635. end
  1636. end
  1637. if toughness > 0 and rays > 0 then
  1638. local found = false
  1639. for i,v in pairs(oldobjhit) do if v and obj:IsDescendantOf(v) then found = true; end; end;
  1640. oldobjhit = objhit
  1641. if not plrhit and not found then
  1642. rays = rays - 1
  1643. wait()
  1644. end
  1645. local ig = {char,gun,script,unpack(objhit)}
  1646. local _obj,_vec,_rot = raycast(objpos,(hitpos-han.Position).Unit, nil, ig) -- (hitpos-objpos).Unit
  1647. check(toughness,_obj,_vec,p,rays,_rot)
  1648. else
  1649. p:Destroy()
  1650. end
  1651. end
  1652.  
  1653. function drop_shell()
  1654. local Shell = Instance.new("Part")
  1655. Shell.Color = Color3.new(1, 1, 0)
  1656. Shell.Size = Vector3.new(0.530001819, 0.132500455, 0.132500455)
  1657. Shell.BottomSurface = Enum.SurfaceType.Smooth
  1658. Shell.BrickColor = BrickColor.new("New Yeller")
  1659. Shell.Material = Enum.Material.Metal
  1660. Shell.Shape = Enum.PartType.Cylinder
  1661. Shell.CFrame = han.CFrame
  1662. Shell.Parent = script
  1663. local bvs = Instance.new("BodyVelocity")
  1664. bvs.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1665. bvs.Velocity = han.CFrame.lookVector+Vector3.new(0,10,-5)
  1666. bvs.Parent = Shell
  1667. game:GetService("Debris"):AddItem(bvs,0.1)
  1668. game:GetService("Debris"):AddItem(Shell,10)
  1669. end
  1670.  
  1671. function Shoot()
  1672. if not using and CheckIfAlive() and ammo > 0 then
  1673. using = true
  1674. wait()
  1675. tween:Create(gun,TweenInfo.new(0.1),({Grip = CFrame.new(-0.412492037, -0.018754568, -1.72672331, -4.80075322e-08, 0.998761177, 0.0497615375, 1, 4.37113883e-08, 8.74227695e-08, 8.51393267e-08, 0.0497615412, -0.998761117)})):Play()
  1676. spawn(function()
  1677. flash.Enabled = true
  1678. light.Enabled = true
  1679. smoke.Enabled = true
  1680. wait()
  1681. flash.Enabled = false
  1682. light.Enabled = false
  1683. smoke.Enabled = false
  1684. end)
  1685. spawn(function()
  1686. for i = 1,bulletfire do
  1687. ammo = ammo - 1
  1688. drop_shell()
  1689. --shoot_s.SoundId = 'rbxassetid://' .. sh[math.random(1,#shots)]
  1690. shoot_s:Play()
  1691. for i,v in ipairs(objhit) do table.remove(objhit,i); end;
  1692. for i,v in ipairs(objhit) do table.remove(oldobjhit,i); end;
  1693. spawn(function()
  1694. local p = Instance.new("Part")
  1695. p.Name = "bullet"
  1696. p.Massless = true
  1697. p.Anchored = false
  1698. p.CanCollide = false
  1699. p.Color = Color3.fromRGB(255, 255, 0)
  1700. p.Size = Vector3.new(0.5,0.5,1)
  1701. p.Transparency = 0
  1702. p.Position = han.Position
  1703. p.CFrame = CFrame.new(han.Position,hitpos)
  1704. p.Velocity = p.CFrame.lookVector * 2000
  1705. p.Material = Enum.Material.Neon
  1706. p.Parent = script
  1707. local mesh = Instance.new("SpecialMesh")
  1708. mesh.MeshType = Enum.MeshType.Sphere
  1709. mesh.Parent = p
  1710. --tween:Create(p,TweenInfo.new(((hitpos)-han.Position).Magnitude/10000),{Position = p.Position + ((hitpos)-han.Position).Unit*1000}):Play()
  1711. local body_vel = Instance.new("BodyVelocity")
  1712. body_vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1713. body_vel.Velocity = p.CFrame.lookVector * 2000
  1714. body_vel.Parent = p
  1715. debris:AddItem(p,3)
  1716. game:GetService("TweenService"):Create(p,TweenInfo.new(3),{Size = Vector3.new(0.5,0.5,10),Transparency = 1}):Play()
  1717. local toughness = 1/0
  1718. local rays = 5
  1719. local ig = {char,gun,script}
  1720. local obj,vec,rot = raycast(han.Position,(hitpos-han.Position).Unit, nil, ig)
  1721. check(toughness,obj,vec,p,rays,rot)
  1722. end)
  1723. remote:FireClient(plr,1,shoot_s.SoundId,shoot_s,5,han)
  1724. wait(shootwait/bulletfire)
  1725. end
  1726. end)
  1727. spawn(function()
  1728. wait(0.1)
  1729. tween:Create(gun,TweenInfo.new(0.1),({Grip = CFrame.new(-0.497905374, -0.018754568, -1.70405805, -4.37113883e-08, 1, 0, 1, 4.37113883e-08, 8.74227695e-08, 8.74227766e-08, 3.82137093e-15, -0.99999994)})):Play()
  1730. end)
  1731. wait(shootwait)
  1732. using = false
  1733. end
  1734. end
  1735.  
  1736. gun.Activated:Connect(function()
  1737. if not using and CheckIfAlive() and 0 >= ammo then
  1738. Reload()
  1739. end
  1740. end)
  1741.  
  1742. gun.Equipped:Connect(function()
  1743. equip:Resume()
  1744. equipped = true
  1745. pcall(function()
  1746. char = gun.Parent
  1747. plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  1748. hum = char:FindFirstChildOfClass("Humanoid")
  1749. torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  1750. rootpart = char:FindFirstChild("HumanoidRootPart")
  1751. if not CheckIfAlive() then gun.Parent = nil; equip:Pause() return end
  1752. end)
  1753. end)
  1754.  
  1755. gun.Unequipped:Connect(function()
  1756. equip:Pause()
  1757. equipped = false
  1758. end)
  1759.  
  1760. remote = Instance.new("RemoteEvent")
  1761. remote.Name = 'bfg_remote'
  1762. remote.Parent = gun
  1763.  
  1764. remote.OnServerEvent:Connect(function(player,mode,data,data2)
  1765. if equipped then else return end
  1766. if plr == player and mode == 1 then
  1767. if data ~= nil then
  1768. hitpos = data
  1769. end
  1770. if data2 ~= nil then
  1771. shooting = data2
  1772. end
  1773. if shooting then
  1774. Shoot()
  1775. end
  1776. elseif not shooting and not using and CheckIfAlive() and plr == player and mode == 2 and data == 'reload' then
  1777. Reload()
  1778. end
  1779. end)
  1780.  
  1781. spawn(function()
  1782. while true do
  1783. game:GetService("TweenService"):Create(han,TweenInfo.new(0.7),{Color = Color3.new(1,0,0)}):Play()
  1784. wait(0.7)
  1785. game:GetService("TweenService"):Create(han,TweenInfo.new(0.7),{Color = Color3.new(0,1,0)}):Play()
  1786. wait(0.7)
  1787. game:GetService("TweenService"):Create(han,TweenInfo.new(0.7),{Color = Color3.new(0,0,1)}):Play()
  1788. wait(0.7)
  1789. end
  1790. end)
  1791.  
  1792. local ls = [[
  1793. local plr = game:GetService("Players").LocalPlayer
  1794. local mouse = plr:GetMouse()
  1795. local char = plr.Character
  1796. local remote = script.Parent
  1797. local tool = remote.Parent
  1798. local shooting = false
  1799. local lh = Vector3.new()
  1800. tool.Equipped:Connect(function()
  1801. pcall(function()
  1802. char = tool.Parent
  1803. end)
  1804. pcall(function()
  1805. plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  1806. end)
  1807. pcall(function()
  1808. mouse = plr:GetMouse()
  1809. end)
  1810. if mouse then
  1811. mouse.KeyDown:Connect(function(key)
  1812. if key == 'r' then
  1813. remote:FireServer(2,'reload')
  1814. end
  1815. end)
  1816. mouse.Button1Down:Connect(function()
  1817. shooting = true
  1818. while shooting do
  1819. local pos
  1820. if mouse.Hit then
  1821. pos = mouse.Hit.Position
  1822. end
  1823. lh = pos or Vector3.new()
  1824. remote:FireServer(1,pos,true)
  1825. wait(0.03)
  1826. end
  1827. remote:FireServer(1,lh,false)
  1828. end)
  1829. mouse.Button1Up:Connect(function()
  1830. shooting = false
  1831. end)
  1832. end
  1833. end)
  1834. remote.OnClientEvent:Connect(function(mode,data,inst,v,p)
  1835. if mode == 1 then
  1836. if inst then inst.Volume = 0; end;
  1837. local sound = Instance.new("Sound")
  1838. sound.SoundId = data
  1839. sound.Volume = v
  1840. sound.Parent = p
  1841. sound:Play()
  1842. elseif mode == 2 then
  1843. --if inst then inst.Transparency = 1; end;
  1844. local decal = Instance.new("Decal")
  1845. decal.Texture = data
  1846. decal.Transparency = v
  1847. decal.Parent = p
  1848. decal.Face = inst
  1849. end
  1850. end)
  1851. ]]
  1852.  
  1853. NLS(ls,remote)
Add Comment
Please, Sign In to add comment