KrYn0MoRe

butterfly/balisong knife v2.2

Aug 4th, 2020 (edited)
1,894
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 78.18 KB | None | 0 0
  1. Tool0 = Instance.new("Tool")
  2. Part1 = Instance.new("Part")
  3. SpecialMesh2 = Instance.new("SpecialMesh")
  4. Part3 = Instance.new("Part")
  5. SpecialMesh4 = Instance.new("SpecialMesh")
  6. Part5 = Instance.new("Part")
  7. SpecialMesh6 = Instance.new("SpecialMesh")
  8. Part7 = Instance.new("Part")
  9. SpecialMesh8 = Instance.new("SpecialMesh")
  10. Part9 = Instance.new("Part")
  11. Part10 = Instance.new("Part")
  12. ParticleEmitter11 = Instance.new("ParticleEmitter")
  13. Part12 = Instance.new("Part")
  14. Part13 = Instance.new("Part")
  15. Tool0.Name = "KrY's Balisong"
  16. Tool0.Parent = nil
  17. Tool0.Grip = CFrame.new(-0.488691062, 0.0183694493, -0.0276023746, -4.37113847e-08, 0.99999994, 0, 4.37113883e-08, 1.91068547e-15, 0.99999994, 1, 4.37113883e-08, -4.37113847e-08)
  18. Part1.Name = "Blade"
  19. Part1.Parent = Tool0
  20. Part1.CFrame = CFrame.new(-6.14499998, 1.48699999, -11.9829998, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)
  21. Part1.Orientation = Vector3.new(0, 90, 90)
  22. Part1.Position = Vector3.new(-6.14499998, 1.48699999, -11.9829998)
  23. Part1.Rotation = Vector3.new(90, 90, 0)
  24. Part1.Color = Color3.new(1, 1, 0)
  25. Part1.Size = Vector3.new(0.967000008, 0.231999993, 0.0529999994)
  26. Part1.Anchored = true
  27. Part1.BottomSurface = Enum.SurfaceType.Smooth
  28. Part1.BrickColor = BrickColor.new("New Yeller")
  29. Part1.Material = Enum.Material.Metal
  30. Part1.TopSurface = Enum.SurfaceType.Smooth
  31. Part1.brickColor = BrickColor.new("New Yeller")
  32. SpecialMesh2.Parent = Part1
  33. SpecialMesh2.MeshId = "rbxassetid://2186769714"
  34. SpecialMesh2.Scale = Vector3.new(0.158000007, 0.158000007, 0.158000007)
  35. SpecialMesh2.TextureId = "rbxassetid://386515810"
  36. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  37. Part3.Name = "Latch"
  38. Part3.Parent = Tool0
  39. Part3.CFrame = CFrame.new(-6.13899994, 0.0560000017, -11.9630003, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)
  40. Part3.Orientation = Vector3.new(0, 90, 90)
  41. Part3.Position = Vector3.new(-6.13899994, 0.0560000017, -11.9630003)
  42. Part3.Rotation = Vector3.new(90, 90, 0)
  43. Part3.Color = Color3.new(0.960784, 0.803922, 0.188235)
  44. Part3.Size = Vector3.new(0.0710000023, 0.231000006, 0.0529999994)
  45. Part3.Anchored = true
  46. Part3.BottomSurface = Enum.SurfaceType.Smooth
  47. Part3.BrickColor = BrickColor.new("Bright yellow")
  48. Part3.Material = Enum.Material.Metal
  49. Part3.TopSurface = Enum.SurfaceType.Smooth
  50. Part3.brickColor = BrickColor.new("Bright yellow")
  51. SpecialMesh4.Parent = Part3
  52. SpecialMesh4.MeshId = "rbxassetid://2186770371"
  53. SpecialMesh4.Scale = Vector3.new(0.158000007, 0.158000007, 0.158000007)
  54. SpecialMesh4.TextureId = "rbxassetid://4923218048"
  55. SpecialMesh4.MeshType = Enum.MeshType.FileMesh
  56. Part5.Name = "Bite"
  57. Part5.Parent = Tool0
  58. Part5.CFrame = CFrame.new(-6.13899994, 0.575999975, -12.0559998, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)
  59. Part5.Orientation = Vector3.new(0, 90, 90)
  60. Part5.Position = Vector3.new(-6.13899994, 0.575999975, -12.0559998)
  61. Part5.Rotation = Vector3.new(90, 90, 0)
  62. Part5.Color = Color3.new(0.960784, 0.803922, 0.188235)
  63. Part5.Size = Vector3.new(1.12, 0.119000003, 0.140000001)
  64. Part5.Anchored = true
  65. Part5.BottomSurface = Enum.SurfaceType.Smooth
  66. Part5.BrickColor = BrickColor.new("Bright yellow")
  67. Part5.Material = Enum.Material.Metal
  68. Part5.TopSurface = Enum.SurfaceType.Smooth
  69. Part5.brickColor = BrickColor.new("Bright yellow")
  70. SpecialMesh6.Parent = Part5
  71. SpecialMesh6.MeshId = "rbxassetid://2186769971"
  72. SpecialMesh6.Scale = Vector3.new(0.158000007, 0.158000007, 0.158000007)
  73. SpecialMesh6.TextureId = "rbxassetid://4923218048"
  74. SpecialMesh6.MeshType = Enum.MeshType.FileMesh
  75. Part7.Name = "FakeHandle"
  76. Part7.Parent = Tool0
  77. Part7.CFrame = CFrame.new(-6.13899994, 0.575999975, -11.9209995, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)
  78. Part7.Orientation = Vector3.new(0, 90, 90)
  79. Part7.Position = Vector3.new(-6.13899994, 0.575999975, -11.9209995)
  80. Part7.Rotation = Vector3.new(90, 90, 0)
  81. Part7.Color = Color3.new(0.960784, 0.803922, 0.188235)
  82. Part7.Size = Vector3.new(1.12, 0.119000003, 0.140000001)
  83. Part7.Anchored = true
  84. Part7.BottomSurface = Enum.SurfaceType.Smooth
  85. Part7.BrickColor = BrickColor.new("Bright yellow")
  86. Part7.Material = Enum.Material.Metal
  87. Part7.TopSurface = Enum.SurfaceType.Smooth
  88. Part7.brickColor = BrickColor.new("Bright yellow")
  89. SpecialMesh8.Parent = Part7
  90. SpecialMesh8.MeshId = "rbxassetid://2186770196"
  91. SpecialMesh8.Scale = Vector3.new(0.158000007, 0.158000007, 0.158000007)
  92. SpecialMesh8.TextureId = "rbxassetid://4923218048"
  93. SpecialMesh8.MeshType = Enum.MeshType.FileMesh
  94. Part9.Name = "lw"
  95. Part9.Parent = Tool0
  96. Part9.CFrame = CFrame.new(-6.13899994, 0.0560000017, -12.059, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)
  97. Part9.Orientation = Vector3.new(0, 90, 90)
  98. Part9.Position = Vector3.new(-6.13899994, 0.0560000017, -12.059)
  99. Part9.Rotation = Vector3.new(90, 90, 0)
  100. Part9.Color = Color3.new(0.960784, 0.803922, 0.188235)
  101. Part9.Transparency = 1
  102. Part9.Size = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  103. Part9.Anchored = true
  104. Part9.BottomSurface = Enum.SurfaceType.Smooth
  105. Part9.BrickColor = BrickColor.new("Bright yellow")
  106. Part9.Material = Enum.Material.Metal
  107. Part9.TopSurface = Enum.SurfaceType.Smooth
  108. Part9.brickColor = BrickColor.new("Bright yellow")
  109. Part10.Name = "Handle"
  110. Part10.Parent = Tool0
  111. Part10.CFrame = CFrame.new(-6.13899994, 1.00099969, -11.9804993, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)
  112. Part10.Orientation = Vector3.new(0, 90, 90)
  113. Part10.Position = Vector3.new(-6.13899994, 1.00099969, -11.9804993)
  114. Part10.Rotation = Vector3.new(90, 90, 0)
  115. Part10.Color = Color3.new(0.960784, 0.803922, 0.188235)
  116. Part10.Transparency = 1
  117. Part10.Size = Vector3.new(1.96999931, 0.237999991, 0.140000001)
  118. Part10.Anchored = true
  119. Part10.BottomSurface = Enum.SurfaceType.Smooth
  120. Part10.BrickColor = BrickColor.new("Bright yellow")
  121. Part10.Material = Enum.Material.Metal
  122. Part10.TopSurface = Enum.SurfaceType.Smooth
  123. Part10.brickColor = BrickColor.new("Bright yellow")
  124. ParticleEmitter11.Parent = Part10
  125. ParticleEmitter11.Speed = NumberRange.new(0, 0)
  126. ParticleEmitter11.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(0, 1, 0),Color3.new(0, 0, 1))
  127. ParticleEmitter11.LightEmission = 1
  128. ParticleEmitter11.LightInfluence = 1
  129. ParticleEmitter11.Texture = "rbxassetid://243660373"
  130. ParticleEmitter11.Transparency = NumberSequence.new(1,0.80000001192093,0.80000001192093,1)
  131. ParticleEmitter11.ZOffset = 1
  132. ParticleEmitter11.Lifetime = NumberRange.new(1, 1)
  133. ParticleEmitter11.LockedToPart = true
  134. ParticleEmitter11.Rate = 10
  135. Part12.Name = "hw"
  136. Part12.Parent = Tool0
  137. Part12.CFrame = CFrame.new(-6.13899994, 1.08600008, -11.941, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)
  138. Part12.Orientation = Vector3.new(0, 90, 90)
  139. Part12.Position = Vector3.new(-6.13899994, 1.08600008, -11.941)
  140. Part12.Rotation = Vector3.new(90, 90, 0)
  141. Part12.Color = Color3.new(0.972549, 0.972549, 0.972549)
  142. Part12.Transparency = 1
  143. Part12.Size = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  144. Part12.Anchored = true
  145. Part12.BottomSurface = Enum.SurfaceType.Smooth
  146. Part12.BrickColor = BrickColor.new("Institutional white")
  147. Part12.Material = Enum.Material.SmoothPlastic
  148. Part12.TopSurface = Enum.SurfaceType.Smooth
  149. Part12.brickColor = BrickColor.new("Institutional white")
  150. Part13.Name = "bw"
  151. Part13.Parent = Tool0
  152. Part13.CFrame = CFrame.new(-6.13899994, 1.08600008, -12.0359993, 1.91068547e-15, 4.37113883e-08, 1, 1, -4.37113883e-08, 0, 4.37113883e-08, 1, -4.37113883e-08)
  153. Part13.Orientation = Vector3.new(0, 90, 90)
  154. Part13.Position = Vector3.new(-6.13899994, 1.08600008, -12.0359993)
  155. Part13.Rotation = Vector3.new(90, 90, 0)
  156. Part13.Color = Color3.new(0.972549, 0.972549, 0.972549)
  157. Part13.Transparency = 1
  158. Part13.Size = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  159. Part13.Anchored = true
  160. Part13.BottomSurface = Enum.SurfaceType.Smooth
  161. Part13.BrickColor = BrickColor.new("Institutional white")
  162. Part13.Material = Enum.Material.SmoothPlastic
  163. Part13.TopSurface = Enum.SurfaceType.Smooth
  164. Part13.brickColor = BrickColor.new("Institutional white")
  165.  
  166. local knife = Tool0
  167. local handle,fakehandle,blade,latch,bite
  168. local lwp,bwp,hwp
  169.  
  170. local stun_duration = 0.4
  171.  
  172. for i,v in pairs(knife:GetChildren()) do
  173.     if v:IsA("BasePart") then
  174.         v.Locked = true
  175.         v.Massless = true
  176.         v.CanCollide = false
  177.         v.Anchored = false
  178.         if v.Name == 'FakeHandle' then
  179.             fakehandle = v
  180.         elseif v.Name == 'Handle' then
  181.             handle = v
  182.         elseif v.Name == 'Blade' then
  183.             blade = v
  184.         elseif v.Name == 'Latch' then
  185.             latch = v
  186.         elseif v.Name == 'Bite' then
  187.             bite = v
  188.         elseif v.Name == 'lw' then
  189.             lwp = v
  190.         elseif v.Name == 'bw' then
  191.             bwp = v
  192.         elseif v.Name == 'hw' then
  193.             hwp = v
  194.         end
  195.     end
  196. end
  197.  
  198. handle.CanCollide = true
  199. local grip = knife.Grip
  200.  
  201. local hw,lw,bw,_bw
  202.  
  203. for i,v in pairs(knife:GetChildren()) do
  204.     if v:IsA("BasePart") then
  205.         if v.Name == 'FakeHandle' then
  206.             hw = Instance.new("Weld",v)
  207.             hw.Part0 = hwp
  208.             hw.Part1 = v
  209.             hw.C0 = CFrame.new()*CFrame.Angles(0,0,math.rad(-178.2))
  210.             hw.C1 = CFrame.new((v.Size.X/2)-0.05,-0.02,0)
  211.             local weld = Instance.new("Weld",handle)
  212.             weld.Part0 = handle
  213.             weld.Part1 = hwp
  214.             weld.C0 = handle.CFrame:Inverse()
  215.             weld.C1 = hwp.CFrame:Inverse()
  216.         elseif v.Name == 'Blade' then
  217.             _bw = Instance.new("Weld",v)
  218.             _bw.Part0 = handle
  219.             _bw.Part1 = v
  220.             _bw.C0 = handle.CFrame:Inverse()
  221.             _bw.C1 = v.CFrame:Inverse()
  222.         elseif v.Name == 'Latch' then
  223.             lw = Instance.new("Weld",v)
  224.             lw.Part0 = lwp
  225.             lw.Part1 = v
  226.             lw.C0 = CFrame.new()*CFrame.Angles(0,0,math.rad(178.2))
  227.             lw.C1 = CFrame.new(0,(-v.Size.Y/2)+0.02,0)
  228.             local weld = Instance.new("Weld",bite)
  229.             weld.Part0 = bite
  230.             weld.Part1 = lwp
  231.             weld.C0 = bite.CFrame:Inverse()
  232.             weld.C1 = lwp.CFrame:Inverse()
  233.         elseif v.Name == 'Bite' then
  234.             bw = Instance.new("Weld",bwp)
  235.             bw.Part0 = bwp
  236.             bw.Part1 = v
  237.             bw.C0 = CFrame.new()*CFrame.Angles(0,0,math.rad(178.2))
  238.             bw.C1 = CFrame.new((v.Size.X/2)-0.05,0.02,0)
  239.             local weld = Instance.new("Weld",handle)
  240.             weld.Part0 = handle
  241.             weld.Part1 = bwp
  242.             weld.C0 = handle.CFrame:Inverse()
  243.             weld.C1 = bwp.CFrame:Inverse()
  244.         end
  245.     end
  246. end
  247.  
  248. --
  249. local a1,a2,k_trail = Instance.new("Attachment"),Instance.new("Attachment"),Instance.new("Trail")
  250. a1.Parent = blade
  251. a1.Position = Vector3.new(0, (blade.Size.X/2), 0)
  252. a2.Parent = blade
  253. a2.Position = Vector3.new(0, -(blade.Size.X/2), 0)
  254. k_trail.Parent = blade
  255. k_trail.Attachment0 = a1
  256. k_trail.Attachment1 = a2
  257. k_trail.MinLength = 0
  258. k_trail.LightInfluence = 1
  259. k_trail.Transparency = NumberSequence.new(0,1)
  260. k_trail.Lifetime = 0.5
  261. k_trail.Enabled = false
  262. --
  263. local spark = Instance.new("ParticleEmitter")
  264. spark.Enabled = false
  265. spark.Name = "spark"
  266. spark.Parent = blade
  267. spark.Speed = NumberRange.new(0.20000000298023, 0.20000000298023)
  268. spark.Rotation = NumberRange.new(45, 45)
  269. spark.Color = ColorSequence.new(Color3.new(1, 0.784314, 0), Color3.new(1, 1, 0.203922))
  270. spark.LightEmission = 3
  271. spark.Texture = "rbxassetid://134531274"
  272. spark.ZOffset = 2
  273. spark.Size = NumberSequence.new(0.24999976158142,0)
  274. spark.Lifetime = NumberRange.new(1, 2)
  275. spark.Rate = 400
  276. spark.Speed = NumberRange.new(0.5, 1)
  277. spark.RotSpeed = NumberRange.new(20, 20)
  278. spark.SpreadAngle = Vector2.new(180, 180)
  279. spark.VelocitySpread = 180
  280. --
  281. local glow = Instance.new("ParticleEmitter")
  282. glow.Parent = handle
  283. glow.Speed = NumberRange.new(0, 0)
  284. glow.Color = ColorSequence.new({
  285.     ColorSequenceKeypoint.new(0,Color3.new(0, 0, 0.498039)),
  286.     ColorSequenceKeypoint.new(1,Color3.new(1, 0, 0.498039)),
  287. })
  288. glow.LightEmission = 1
  289. glow.LightInfluence = 1
  290. glow.Texture = "rbxassetid://243660373"
  291. glow.Transparency = NumberSequence.new({
  292.     NumberSequenceKeypoint.new(0,1),
  293.     NumberSequenceKeypoint.new(0.0999,0.8),
  294.     NumberSequenceKeypoint.new(0.798,0.8),
  295.     NumberSequenceKeypoint.new(1,1),
  296. })
  297. glow.ZOffset = 1
  298. glow.Lifetime = NumberRange.new(1, 1)
  299. glow.LockedToPart = true
  300. glow.Rate = 10
  301. --
  302.  
  303. local plr = owner
  304. local char = plr.Character
  305. local hum = char:FindFirstChildOfClass("Humanoid")
  306. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  307. local rootpart = char:FindFirstChild("HumanoidRootPart")
  308. local larm,rarm,lleg,rleg,head = char:FindFirstChild("Left Arm"),char:FindFirstChild("Right Arm"),char:FindFirstChild("Left Leg"),char:FindFirstChild("Right Leg"),char:FindFirstChild("Head")
  309. if larm and rarm and lleg and rleg and head--[[hum.RigType ~= Enum.HumanoidRigType.R6]] then else warn('Character must be R6.'); return; end;
  310.  
  311. local opening = false
  312. local stabbing = false
  313. local equipped = false
  314. local hit_wall = false
  315. local wait_time = 0.4
  316.  
  317. local stabs = {4988621662,4988621968,4988622242,4988625180}
  318. local wallhits = {3203893315,3203893704,3203893934}
  319. local skins = {
  320.     function() -- rainbow gold
  321.         for i,v in pairs(knife:GetDescendants()) do
  322.             if v:IsA("SpecialMesh") then
  323.                 if v.Parent ~= blade then
  324.                     v.TextureId = 'rbxassetid://4923218048'
  325.                 elseif v.Parent == blade then
  326.                     v.TextureId = 'rbxassetid://386515810'
  327.                 end
  328.             end
  329.         end
  330.         k_trail.Color = ColorSequence.new({
  331.             ColorSequenceKeypoint.new(0,Color3.new(1, 0, 0)),
  332.             ColorSequenceKeypoint.new(0.5,Color3.new(0, 1, 0)),
  333.             ColorSequenceKeypoint.new(1,Color3.new(0, 0, 1)),
  334.         })
  335.         glow.Color = ColorSequence.new({
  336.             ColorSequenceKeypoint.new(0,Color3.new(1, 0, 0)),
  337.             ColorSequenceKeypoint.new(0.5,Color3.new(0, 1, 0)),
  338.             ColorSequenceKeypoint.new(1,Color3.new(0, 0, 1)),
  339.         })
  340.     end,
  341.     function() -- dark matter
  342.         for i,v in pairs(knife:GetDescendants()) do
  343.             if v:IsA("SpecialMesh") then
  344.                 if v.Parent ~= blade then
  345.                     v.TextureId = 'rbxassetid://654279108'
  346.                 elseif v.Parent == blade then
  347.                     v.TextureId = 'rbxassetid://725340593'
  348.                 end
  349.             end
  350.         end
  351.         k_trail.Color = ColorSequence.new({
  352.             ColorSequenceKeypoint.new(0,Color3.new(0, 0, 0.498039)),
  353.             ColorSequenceKeypoint.new(1,Color3.new(0, 0, 0)),
  354.         })
  355.         glow.Color = ColorSequence.new({
  356.             ColorSequenceKeypoint.new(0,Color3.new(0, 0, 0.498039)),
  357.             ColorSequenceKeypoint.new(1,Color3.new(0, 0, 0)),
  358.         })
  359.     end,
  360.     function() -- doppler emerald
  361.         for i,v in pairs(knife:GetDescendants()) do
  362.             if v:IsA("SpecialMesh") then
  363.                 if v.Parent ~= blade then
  364.                     v.TextureId = 'rbxassetid://465512235'
  365.                 elseif v.Parent == blade then
  366.                     v.TextureId = 'rbxassetid://438897259'
  367.                 end
  368.             end
  369.         end
  370.         k_trail.Color = ColorSequence.new({
  371.             ColorSequenceKeypoint.new(0,Color3.new(0, 0.666667, 0)),
  372.             ColorSequenceKeypoint.new(1,Color3.new(0.666667, 0.666667, 1)),
  373.         })
  374.         glow.Color = ColorSequence.new({
  375.             ColorSequenceKeypoint.new(0,Color3.new(0, 0.666667, 0)),
  376.             ColorSequenceKeypoint.new(1,Color3.new(0.666667, 0.666667, 1)),
  377.         })
  378.     end,
  379.     function() -- ruby
  380.         for i,v in pairs(knife:GetDescendants()) do
  381.             if v:IsA("SpecialMesh") then
  382.                 if v.Parent ~= blade then
  383.                     v.TextureId = 'rbxassetid://632684827'
  384.                 elseif v.Parent == blade then
  385.                     v.TextureId = 'rbxassetid://3047348663'
  386.                 end
  387.             end
  388.         end
  389.         k_trail.Color = ColorSequence.new({
  390.             ColorSequenceKeypoint.new(0,Color3.new(1, 0, 0)),
  391.             ColorSequenceKeypoint.new(1,Color3.new(1, 0, 0.498039)),
  392.         })
  393.         glow.Color = ColorSequence.new({
  394.             ColorSequenceKeypoint.new(0,Color3.new(1, 0, 0)),
  395.             ColorSequenceKeypoint.new(1,Color3.new(1, 0, 0.498039)),
  396.         })
  397.     end,
  398.     function() -- doppler galaxy
  399.         for i,v in pairs(knife:GetDescendants()) do
  400.             if v:IsA("SpecialMesh") then
  401.                 if v.Parent ~= blade then
  402.                     v.TextureId = 'rbxassetid://5429699047'
  403.                 elseif v.Parent == blade then
  404.                     v.TextureId = 'rbxassetid://1094064933'
  405.                 end
  406.             end
  407.         end
  408.         k_trail.Color = ColorSequence.new({
  409.             ColorSequenceKeypoint.new(0,Color3.new(0, 0, 0.498039)),
  410.             ColorSequenceKeypoint.new(1,Color3.new(1, 0, 0.498039)),
  411.         })
  412.         glow.Color = ColorSequence.new({
  413.             ColorSequenceKeypoint.new(0,Color3.new(0, 0, 0.498039)),
  414.             ColorSequenceKeypoint.new(1,Color3.new(1, 0, 0.498039)),
  415.         })
  416.     end,
  417.     function() -- pattern 1 (white and alder)
  418.         for i,v in pairs(knife:GetDescendants()) do
  419.             if v:IsA("SpecialMesh") then
  420.                 if v.Parent ~= blade then
  421.                     v.TextureId = 'rbxassetid://49942836'
  422.                 elseif v.Parent == blade then
  423.                     v.TextureId = 'rbxassetid://5127790558'
  424.                 end
  425.             end
  426.         end
  427.         k_trail.Color = ColorSequence.new({
  428.             ColorSequenceKeypoint.new(0,Color3.fromRGB(255, 85, 127)),
  429.             ColorSequenceKeypoint.new(0.5,Color3.new(1, 1, 1)),
  430.             ColorSequenceKeypoint.new(1,Color3.fromRGB(170, 85, 255)),
  431.         })
  432.         glow.Color = ColorSequence.new({
  433.             ColorSequenceKeypoint.new(0,Color3.fromRGB(255, 85, 127)),
  434.             ColorSequenceKeypoint.new(0.5,Color3.new(1, 1, 1)),
  435.             ColorSequenceKeypoint.new(1,Color3.fromRGB(170, 85, 255)),
  436.         })
  437.     end,
  438.     function() -- pattern 2 (dark red)
  439.         for i,v in pairs(knife:GetDescendants()) do
  440.             if v:IsA("SpecialMesh") then
  441.                 if v.Parent ~= blade then
  442.                     v.TextureId = 'rbxassetid://3196461767'
  443.                 elseif v.Parent == blade then
  444.                     v.TextureId = 'rbxassetid://3534795831'
  445.                 end
  446.             end
  447.         end
  448.         k_trail.Color = ColorSequence.new({
  449.             ColorSequenceKeypoint.new(0,Color3.fromRGB(85, 0, 0)),
  450.             ColorSequenceKeypoint.new(1,Color3.fromRGB(170, 0, 0)),
  451.         })
  452.         glow.Color = ColorSequence.new({
  453.             ColorSequenceKeypoint.new(0,Color3.fromRGB(85, 0, 0)),
  454.             ColorSequenceKeypoint.new(1,Color3.fromRGB(170, 0, 0)),
  455.         })
  456.     end,
  457.     function() -- pattern 3 (blue, yellow, green)
  458.         for i,v in pairs(knife:GetDescendants()) do
  459.             if v:IsA("SpecialMesh") then
  460.                 if v.Parent ~= blade then
  461.                     v.TextureId = 'rbxassetid://164867621'
  462.                 elseif v.Parent == blade then
  463.                     v.TextureId = 'rbxassetid://522913487'
  464.                 end
  465.             end
  466.         end
  467.         k_trail.Color = ColorSequence.new({
  468.             ColorSequenceKeypoint.new(0,Color3.fromRGB(0, 85, 255)),
  469.             ColorSequenceKeypoint.new(0.5,Color3.fromRGB(255, 255, 0)),
  470.             ColorSequenceKeypoint.new(1,Color3.fromRGB(0, 170, 0)),
  471.         })
  472.         glow.Color = ColorSequence.new({
  473.             ColorSequenceKeypoint.new(0,Color3.fromRGB(0, 85, 255)),
  474.             ColorSequenceKeypoint.new(0.5,Color3.fromRGB(255, 255, 0)),
  475.             ColorSequenceKeypoint.new(1,Color3.fromRGB(0, 170, 0)),
  476.         })
  477.     end,
  478.     function() -- pattern 4 (black and white)
  479.         for i,v in pairs(knife:GetDescendants()) do
  480.             if v:IsA("SpecialMesh") then
  481.                 if v.Parent ~= blade then
  482.                     v.TextureId = 'rbxassetid://148291781'
  483.                 elseif v.Parent == blade then
  484.                     v.TextureId = 'rbxassetid://82909557'
  485.                 end
  486.             end
  487.         end
  488.         k_trail.Color = ColorSequence.new({
  489.             ColorSequenceKeypoint.new(0,Color3.fromRGB(1, 1, 1)),
  490.             ColorSequenceKeypoint.new(1,Color3.fromRGB(0, 0, 0)),
  491.         })
  492.         glow.Color = ColorSequence.new({
  493.             ColorSequenceKeypoint.new(0,Color3.fromRGB(1, 1, 1)),
  494.             ColorSequenceKeypoint.new(1,Color3.fromRGB(0, 0, 0)),
  495.         })
  496.     end,
  497. }
  498.  
  499. local bloodlol_t = {}
  500.  
  501. local hitwall = Instance.new("Sound")
  502. hitwall.SoundId = 'rbxassetid://' .. wallhits[math.random(1,#wallhits)]
  503. hitwall.Volume = 0.6
  504. hitwall.Parent = blade
  505.  
  506. local swing_s = Instance.new("Sound")
  507. swing_s.SoundId = 'rbxassetid://138097048'
  508. swing_s.Volume = 0.4
  509. swing_s.Parent = blade
  510.  
  511. local stab_s = Instance.new("Sound")
  512. stab_s.SoundId = 'rbxassetid://' .. stabs[math.random(1,#stabs)]
  513. stab_s.Volume = 0.5
  514. stab_s.Parent = blade
  515.  
  516. local equip_s = Instance.new("Sound")
  517. equip_s.SoundId = 'rbxassetid://179662797' -- 3688156764
  518. equip_s.Volume = 0.7
  519. equip_s.Parent = blade
  520.  
  521. --[[
  522. local equip_woosh_s = Instance.new("Sound")
  523. equip_woosh_s.SoundId = 'rbxassetid://138097048'
  524. equip_woosh_s.PlaybackSpeed = 1.3
  525. equip_woosh_s.Volume = 0.5
  526. equip_woosh_s.Parent = blade
  527. ]]
  528.  
  529. local wbreak = Instance.new("Sound")
  530. wbreak.Parent = blade
  531. wbreak.SoundId = "rbxassetid://627558611"
  532. wbreak.Volume = 0.7
  533. wbreak.Parent = blade
  534.  
  535. local swing_anims = {--[[33169596,]]204062532,54432537,218504594,54584713} -- 186934910
  536.  
  537. local idleanimation = Instance.new("Animation")
  538. idleanimation.AnimationId = "rbxassetid://241279220"
  539.  
  540. local idleanim = hum:LoadAnimation(idleanimation)
  541.  
  542. local swing_animation = Instance.new("Animation")
  543. swing_animation.AnimationId = "rbxassetid://" .. swing_anims[math.random(1,#swing_anims)]
  544.  
  545. local swing_anim = hum:LoadAnimation(swing_animation)
  546.  
  547. local animval = math.random(1,#swing_anims)
  548.  
  549. skins[math.random(1,#skins)]()
  550.  
  551. knife.Parent = plr:FindFirstChildOfClass("Backpack")
  552. knife.RequiresHandle = false
  553.  
  554. --//=================================\\
  555. --|| SAZERENOS' ARTIFICIAL HEARTBEAT
  556. --\\=================================//
  557.  
  558. ArtificialHB = Instance.new("BindableEvent", script)
  559. ArtificialHB.Name = "ArtificialHB"
  560.  
  561. script:WaitForChild("ArtificialHB")
  562.  
  563. frame = (1/60)
  564. tf = 0
  565. allowframeloss = false
  566. tossremainder = false
  567. lastframe = tick()
  568. script.ArtificialHB:Fire()
  569.  
  570. game:GetService("RunService").Heartbeat:connect(function(s, p)
  571.     tf = tf + s
  572.     if tf >= frame then
  573.         if allowframeloss then
  574.             script.ArtificialHB:Fire()
  575.             lastframe = tick()
  576.         else
  577.             for i = 1, math.floor(tf / frame) do
  578.                 script.ArtificialHB:Fire()
  579.             end
  580.         lastframe = tick()
  581.         end
  582.         if tossremainder then
  583.             tf = 0
  584.         else
  585.             tf = tf - frame * math.floor(tf / frame)
  586.         end
  587.     end
  588. end)
  589.  
  590. function Swait(NUMBER)
  591.     if NUMBER == 0 or NUMBER == nil then
  592.         ArtificialHB.Event:wait()
  593.     else
  594.         for i = 1, NUMBER do
  595.             ArtificialHB.Event:wait()
  596.         end
  597.     end
  598. end
  599.  
  600. --//=================================\\
  601. --\\=================================//
  602.  
  603. function bleed2(frick,targhum,can_hurt,t,splat)
  604.     spawn(function()
  605.     if not frick:FindFirstChild("bleeding from kry's combat") then else return end
  606.     local tempbleedval = Instance.new("ObjectValue")
  607.     tempbleedval.Name = "bleeding from kry's combat"
  608.     tempbleedval.Parent = frick
  609.     local bleeding = true
  610.     local rig = targhum.RigType
  611.     local limbs = {'Head','Left Arm','Right Arm','Left Leg','Right Leg','RightUpperLeg','LeftUpperLeg','RightUpperArm','LeftUpperArm','RightLowerLeg','LeftLowerLeg','RightLowerArm','LeftLowerArm','RightFoot','LeftFoot','RightHand','LeftHand'}
  612.     spawn(function()
  613.         wait(t)
  614.         bleeding = false
  615.         tempbleedval:Destroy()
  616.     end)
  617.     while bleeding and frick and frick.Parent do
  618.         if --[[(targhum and targhum.Parent and targhum.Health > 0) or]] (not frick or not frick.Parent or not targhum or not targhum.Parent) then
  619.             break
  620.         end
  621.         if targhum and 0 >= targhum.Health then
  622.             local tempkillval = Instance.new("ObjectValue",targhum)
  623.             tempkillval.Name = "killer"
  624.             tempkillval.Value = plr
  625.             pcall(function()
  626.                 Ragdoll(targhum.Parent,false,true,true)
  627.             end)
  628.         end
  629.         local max_limbs = 0
  630.         local current_limbs = 0
  631.         local gone_limbs = 0
  632.         local targchar = targhum.Parent
  633.         if rig == Enum.HumanoidRigType.R6 then
  634.             max_limbs = 5
  635.         elseif rig == Enum.HumanoidRigType.R15 then
  636.             max_limbs = 13
  637.         end
  638.         for i,v in pairs(targchar:GetChildren()) do
  639.             local found = false
  640.             for i,n in pairs(limbs) do if n == v.Name then found = true; end; end;
  641.             if found and not v:FindFirstChild("Dismembered") then
  642.                 current_limbs = current_limbs + 1
  643.             end
  644.         end
  645.         gone_limbs = (max_limbs-current_limbs)
  646.         if targhum and can_hurt then
  647.             if gone_limbs >= 1 then
  648.                 targhum:TakeDamage(0.5*gone_limbs)
  649.             else
  650.                 targhum:TakeDamage(0.5)
  651.             end
  652.         end
  653.         spawn(function()
  654.             local thing = Instance.new('Part')
  655.             thing.Parent = workspace
  656.             thing.Size = Vector3.new(0.1,0.1,0.1)
  657.             thing.CFrame = frick.CFrame*CFrame.new(0,frick.Size.Y/2,0)
  658.             if splat then
  659.                 thing.Transparency = 0
  660.             elseif not splat then
  661.                 thing.Transparency = 1
  662.             end
  663.             thing.Color = Color3.fromRGB(75, 0, 0)
  664.             thing.Material = Enum.Material.Glass
  665.             thing.Name = "blood_drop"
  666.             thing.CanCollide =false
  667.             thing:BreakJoints()
  668.             local mesh = Instance.new('SpecialMesh')
  669.             mesh.MeshType = Enum.MeshType.Sphere
  670.             mesh.Parent = thing
  671.             --game:GetService("Debris"):AddItem(thing,5)
  672.             local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
  673.             att1.Parent = thing
  674.             att1.Position = Vector3.new(0,-(thing.Size.Y/2),0)
  675.             att2.Parent = thing
  676.             att2.Position = Vector3.new(0,(thing.Size.Y/2),0)
  677.             if splat then
  678.                 local trail_drop = Instance.new("Trail")
  679.                 trail_drop.Parent = thing
  680.                 trail_drop.Attachment0 = att1
  681.                 trail_drop.Attachment1 = att2
  682.                 trail_drop.Color = ColorSequence.new(Color3.new(0.294118, 0, 0),Color3.new(0.294118, 0, 0))
  683.                 trail_drop.FaceCamera = true
  684.                 trail_drop.LightInfluence = 1
  685.                 trail_drop.Transparency = NumberSequence.new(0.1,1)
  686.                 trail_drop.Lifetime = 1
  687.                 trail_drop.MinLength = 0
  688.             end
  689.             local rawrxd = Instance.new('BodyForce')
  690.             rawrxd.Parent = thing
  691.             if splat then
  692.                 rawrxd.Force = frick.CFrame.upVector+Vector3.new(math.random(-5, 5)/10,3,math.random(-5, 5)/10)
  693.             elseif not splat then
  694.                 rawrxd.Force = frick.CFrame.upVector*(math.random()*2)+Vector3.new(math.random(-5, 5)/10,1.5,0)
  695.             end
  696.             game:GetService("Debris"):AddItem(rawrxd,0.01)
  697.             thing.Touched:connect(function(tou)
  698.                 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
  699.                     local pos = Vector3.new(thing.Position.X,(tou.Position.Y+(tou.Size.Y/2))+(0.02/2),thing.Position.Z)
  700.                     local Point1 = pos-Vector3.new(0.01,0.01,0.01)
  701.                     local Point2 = pos+Vector3.new(0.01,0.01,0.01)
  702.                     local Region = Region3.new(Point1,Point2)
  703.                     for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
  704.                         if Part.Name == "blood" then
  705.                             tou = Part
  706.                         end
  707.                     end
  708.                     thing:Destroy()
  709.                     if tou.Name == "blood" then
  710.                         local reee = tou.CFrame
  711.                         if tou.Transparency > -0.2 then
  712.                             tou.Transparency = tou.Transparency - 0.1
  713.                         end
  714.                         if tou.Size.X < 5 then
  715.                             tou.Size = tou.Size+Vector3.new(0.4,0,0.4)
  716.                             tou.CFrame = reee
  717.                         elseif tou.Size.X < 7.5 then
  718.                             tou.Size = tou.Size+Vector3.new(0.3,0,0.3)
  719.                             tou.CFrame = reee
  720.                         elseif tou.Size.X < 10 then
  721.                             tou.Size = tou.Size+Vector3.new(0.2,0,0.2)
  722.                             tou.CFrame = reee
  723.                         end
  724.                     elseif tou.CanCollide == true then
  725.                         local bloodlol = Instance.new('Part')
  726.                         if gone_limbs >= 1 then
  727.                             bloodlol.Size = Vector3.new(1*gone_limbs,0.2,1*gone_limbs)
  728.                         else
  729.                             bloodlol.Size = Vector3.new(1,0.2,1)
  730.                         end
  731.                         bloodlol.Name = "blood"
  732.                         bloodlol.Anchored = true
  733.                         bloodlol.CanCollide = false
  734.                         bloodlol.Material = Enum.Material.Glass
  735.                         bloodlol.Color = Color3.fromRGB(75, 0, 0)
  736.                         local mesh = Instance.new('SpecialMesh')
  737.                         mesh.MeshType = Enum.MeshType.Sphere
  738.                         mesh.Parent = bloodlol
  739.                         bloodlol.Parent = workspace
  740.                         bloodlol.CFrame = CFrame.new(pos)
  741.                         table.insert(bloodlol_t,1,bloodlol)
  742.                     end
  743.                 end
  744.             end)
  745.         end)
  746.         wait(0.1)
  747.     end
  748.     if targhum and 0 >= targhum.Health then
  749.         local tempkillval = Instance.new("ObjectValue",targhum)
  750.         tempkillval.Name = "killer"
  751.         tempkillval.Value = plr
  752.         pcall(function()
  753.             Ragdoll(targhum.Parent,false,true,true)
  754.         end)
  755.     end
  756.     tempbleedval:Destroy()
  757.     end)
  758. end
  759. function make_bone(obj,targtorso)
  760.     if obj.Name == 'Left Arm' or obj.Name == 'LeftUpperArm' then
  761.         local bone = Instance.new("Part")
  762.         bone.name = 'bone'
  763.         bone.CanCollide = false
  764.         bone.Anchored = false
  765.         bone.CFrame = targtorso.CFrame
  766.         bone.Size = targtorso.Size
  767.         bone.Massless = true
  768.         bone.Locked = true
  769.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  770.         if not exists then
  771.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  772.         end
  773.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  774.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  775.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  776.         local weld = Instance.new("Weld")
  777.         weld.Part0 = bone
  778.         weld.Part1 = targtorso
  779.         weld.C1 = CFrame.new(-0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(90))
  780.         weld.Parent = bone
  781.         targtorso.Anchored = false
  782.         bone.Parent = script
  783.         local mesh = Instance.new("SpecialMesh")
  784.         mesh.MeshId = 'rbxassetid://1076136382'
  785.         mesh.TextureId = 'rbxassetid://1076137938'
  786.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  787.         mesh.Parent = bone
  788.         --
  789.         local bone = Instance.new("Part")
  790.         bone.Name = 'bone'
  791.         bone.CanCollide = false
  792.         bone.Anchored = false
  793.         bone.CFrame = obj.CFrame
  794.         bone.Size = obj.Size
  795.         bone.Massless = true
  796.         bone.Locked = true
  797.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  798.         if not exists then
  799.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  800.         end
  801.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  802.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  803.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  804.         local weld = Instance.new("Weld")
  805.         weld.Part0 = bone
  806.         weld.Part1 = obj
  807.         weld.C1 = CFrame.new(0.13,0.26,0)
  808.         weld.Parent = bone
  809.         obj.Anchored = false
  810.         bone.Parent = script
  811.         local mesh = Instance.new("SpecialMesh")
  812.         mesh.MeshId = 'rbxassetid://36780032'
  813.         mesh.TextureId = 'rbxassetid://36780292'
  814.         mesh.Parent = bone
  815.     elseif obj.Name == 'Right Arm' or obj.Name == 'RightUpperArm' then
  816.         local bone = Instance.new("Part")
  817.         bone.Name = 'bone'
  818.         bone.CanCollide = false
  819.         bone.Anchored = false
  820.         bone.CFrame = targtorso.CFrame
  821.         bone.Size = targtorso.Size
  822.         bone.Massless = true
  823.         bone.Locked = true
  824.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  825.         if not exists then
  826.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  827.         end
  828.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  829.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  830.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  831.         local weld = Instance.new("Weld")
  832.         weld.Part0 = bone
  833.         weld.Part1 = targtorso
  834.         weld.C1 = CFrame.new(0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(-90))
  835.         weld.Parent = bone
  836.         targtorso.Anchored = false
  837.         bone.Parent = script
  838.         local mesh = Instance.new("SpecialMesh")
  839.         mesh.MeshId = 'rbxassetid://1076136382'
  840.         mesh.TextureId = 'rbxassetid://1076137938'
  841.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  842.         mesh.Parent = bone
  843.         --
  844.         local bone = Instance.new("Part")
  845.         bone.Name = 'bone'
  846.         bone.CanCollide = false
  847.         bone.Anchored = false
  848.         bone.CFrame = obj.CFrame
  849.         bone.Size = obj.Size
  850.         bone.Massless = true
  851.         bone.Locked = true
  852.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  853.         if not exists then
  854.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  855.         end
  856.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  857.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  858.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  859.         local weld = Instance.new("Weld")
  860.         weld.Part0 = bone
  861.         weld.Part1 = obj
  862.         weld.C1 = CFrame.new(-0.13,0.26,0)
  863.         weld.Parent = bone
  864.         obj.Anchored = false
  865.         bone.Parent = script
  866.         local mesh = Instance.new("SpecialMesh")
  867.         mesh.MeshId = 'rbxassetid://36780156'
  868.         mesh.TextureId = 'rbxassetid://36780292'
  869.         mesh.Parent = bone
  870.     elseif obj.Name == 'Left Leg' or obj.Name == 'LeftUpperLeg' then
  871.         local bone = Instance.new("Part")
  872.         bone.Name = 'bone'
  873.         bone.CanCollide = false
  874.         bone.Anchored = false
  875.         bone.CFrame = targtorso.CFrame
  876.         bone.Size = targtorso.Size
  877.         bone.Massless = true
  878.         bone.Locked = true
  879.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  880.         if not exists then
  881.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  882.         end
  883.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  884.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  885.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  886.         local weld = Instance.new("Weld")
  887.         weld.Part0 = bone
  888.         weld.Part1 = targtorso
  889.         weld.C1 = CFrame.new(-0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  890.         weld.Parent = bone
  891.         targtorso.Anchored = false
  892.         bone.Parent = script
  893.         local mesh = Instance.new("SpecialMesh")
  894.         mesh.MeshId = 'rbxassetid://1076136382'
  895.         mesh.TextureId = 'rbxassetid://1076137938'
  896.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  897.         mesh.Parent = bone
  898.         --
  899.         local bone = Instance.new("Part")
  900.         bone.Name = 'bone'
  901.         bone.CanCollide = false
  902.         bone.Anchored = false
  903.         bone.CFrame = obj.CFrame
  904.         bone.Size = obj.Size
  905.         bone.Massless = true
  906.         bone.Locked = true
  907.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  908.         if not exists then
  909.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  910.         end
  911.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  912.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  913.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  914.         local weld = Instance.new("Weld")
  915.         weld.Part0 = bone
  916.         weld.Part1 = obj
  917.         weld.C1 = CFrame.new(0,0.09,0.13)
  918.         weld.Parent = bone
  919.         obj.Anchored = false
  920.         bone.Parent = script
  921.         local mesh = Instance.new("SpecialMesh")
  922.         mesh.MeshId = 'rbxassetid://36780156'
  923.         mesh.TextureId = 'rbxassetid://36780292'
  924.         mesh.Parent = bone
  925.     elseif obj.Name == 'Right Leg' or obj.Name == 'RightUpperLeg' then
  926.         local bone = Instance.new("Part")
  927.         bone.Name = 'bone'
  928.         bone.CanCollide = false
  929.         bone.Anchored = false
  930.         bone.CFrame = targtorso.CFrame
  931.         bone.Size = targtorso.Size
  932.         bone.Massless = true
  933.         bone.Locked = true
  934.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  935.         if not exists then
  936.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  937.         end
  938.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  939.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  940.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  941.         local weld = Instance.new("Weld")
  942.         weld.Part0 = bone
  943.         weld.Part1 = targtorso
  944.         weld.C1 = CFrame.new(0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  945.         weld.Parent = bone
  946.         targtorso.Anchored = false
  947.         bone.Parent = script
  948.         local mesh = Instance.new("SpecialMesh")
  949.         mesh.MeshId = 'rbxassetid://1076136382'
  950.         mesh.TextureId = 'rbxassetid://1076137938'
  951.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  952.         mesh.Parent = bone
  953.         --
  954.         local bone = Instance.new("Part")
  955.         bone.Name = 'bone'
  956.         bone.CanCollide = false
  957.         bone.Anchored = false
  958.         bone.CFrame = obj.CFrame
  959.         bone.Size = obj.Size
  960.         bone.Massless = true
  961.         bone.Locked = true
  962.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  963.         if not exists then
  964.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  965.         end
  966.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  967.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  968.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  969.         local weld = Instance.new("Weld")
  970.         weld.Part0 = bone
  971.         weld.Part1 = obj
  972.         weld.C1 = CFrame.new(0,0.09,0.13)
  973.         weld.Parent = bone
  974.         obj.Anchored = false
  975.         bone.Parent = script
  976.         local mesh = Instance.new("SpecialMesh")
  977.         mesh.MeshId = 'rbxassetid://36780195'
  978.         mesh.TextureId = 'rbxassetid://36780292'
  979.         mesh.Parent = bone
  980.     elseif obj.Name == 'Head' then
  981.         local bone = Instance.new("Part")
  982.         bone.Name = 'bone'
  983.         bone.CanCollide = false
  984.         bone.Anchored = false
  985.         bone.CFrame = targtorso.CFrame
  986.         bone.Size = targtorso.Size
  987.         bone.Massless = true
  988.         bone.Locked = true
  989.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  990.         if not exists then
  991.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  992.         end
  993.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  994.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  995.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  996.         local weld = Instance.new("Weld")
  997.         weld.Part0 = bone
  998.         weld.Part1 = targtorso
  999.         weld.C1 = CFrame.new(0,0.66,0)
  1000.         weld.Parent = bone
  1001.         targtorso.Anchored = false
  1002.         bone.Parent = script
  1003.         local mesh = Instance.new("SpecialMesh")
  1004.         mesh.MeshId = 'rbxassetid://1076136382'
  1005.         mesh.TextureId = 'rbxassetid://1076137938'
  1006.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1007.         mesh.Parent = bone
  1008.         --
  1009.         local bone = Instance.new("Part")
  1010.         bone.Name = 'bone'
  1011.         bone.CanCollide = false
  1012.         bone.Anchored = false
  1013.         bone.CFrame = obj.CFrame
  1014.         bone.Size = obj.Size
  1015.         bone.Massless = true
  1016.         bone.Locked = true
  1017.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1018.         if not exists then
  1019.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1020.         end
  1021.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1022.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1023.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1024.         local weld = Instance.new("Weld")
  1025.         weld.Part0 = bone
  1026.         weld.Part1 = obj
  1027.         weld.C1 = CFrame.new(0,-0.23,0)*CFrame.Angles(0,math.rad(-90),0)
  1028.         weld.Parent = bone
  1029.         obj.Anchored = false
  1030.         bone.Parent = script
  1031.         local mesh = Instance.new("SpecialMesh")
  1032.         mesh.MeshId = 'rbxassetid://1076136382'
  1033.         mesh.TextureId = 'rbxassetid://1076137938'
  1034.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1035.         mesh.Parent = bone
  1036.     end
  1037. end
  1038. function check_weld(v)
  1039.     if v:IsA("Motor6D") or v:IsA("BallSocketConstraint") or v:IsA("Motor") or v:IsA("Constraint") or v:IsA("Weld") or v:IsA("ManualWeld") or v:IsA("WeldConstraint") or v:IsA("ManualGlue") or v:IsA("CylindricalConstraint") or v:IsA("NoCollisionConstraint") or v:IsA("HingeConstraint") then
  1040.         v:Destroy()
  1041.     end
  1042. end
  1043. function limb_collide(obj,mode)
  1044.     if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
  1045.     local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1046.     if not exists then
  1047.         game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1048.     end
  1049.     game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1050.     --
  1051.     local t = {}
  1052.     --
  1053.     local cb = Instance.new("Part")
  1054.     cb.Name = 'limb'
  1055.     cb.Transparency = 1
  1056.     cb.CanCollide = true
  1057.     cb.Anchored = false
  1058.     cb.CFrame = obj.CFrame
  1059.     cb.Size = obj.Size
  1060.     cb.Massless = true
  1061.     cb.Locked = true
  1062.     game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  1063.     game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1064.     local weld = Instance.new("Weld")
  1065.     weld.Part0 = cb
  1066.     weld.Part1 = obj
  1067.     weld.Parent = cb
  1068.     obj.Massless = true
  1069.     obj.Anchored = false
  1070.     if mode or obj:FindFirstChild("Dismembered") then
  1071.         cb.Parent = obj -- .Parent
  1072.     else
  1073.         cb.Parent = script
  1074.         table.insert(t,1,cb)
  1075.     end
  1076.     --
  1077.     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
  1078.         local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
  1079.         local cb2 = Instance.new("Part")
  1080.         cb2.Name = 'limb'
  1081.         cb2.Transparency = 1
  1082.         cb2.CanCollide = true
  1083.         cb2.Anchored = false
  1084.         cb2.CFrame = obj.CFrame
  1085.         cb2.Size = lv
  1086.         cb2.Massless = true
  1087.         cb2.Locked = true
  1088.         local weld2 = Instance.new("Weld")
  1089.         weld2.Part0 = cb
  1090.         weld2.Part1 = cb2
  1091.         weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
  1092.         weld2.Parent = cb2
  1093.         if mode or obj:FindFirstChild("Dismembered") then
  1094.             cb2.Parent = obj -- .Parent
  1095.         else
  1096.             cb2.Parent = script
  1097.             table.insert(t,1,cb2)
  1098.         end
  1099.     end
  1100.     --
  1101.     return t
  1102. end
  1103. 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
  1104.  
  1105. local e_s = 1
  1106.  
  1107. function add_decal(f,t,obj,d,r)
  1108.     spawn(function()
  1109.     local texture = Instance.new("Texture")
  1110.     texture.Parent = obj
  1111.     texture.Face = f
  1112.     texture.Texture = 'rbxassetid://' .. t
  1113.     if not r then
  1114.         game:GetService("Debris"):AddItem(texture,d)
  1115.     end
  1116.     if f == 'Left' or f == 'Right' then
  1117.         texture.StudsPerTileV = obj.Size.Y + e_s
  1118.         if (obj.Size.X > obj.Size.Z) then
  1119.             texture.StudsPerTileV = obj.Size.Z + e_s
  1120.         elseif (obj.Size.Z > obj.Size.X) then
  1121.             texture.StudsPerTileU = obj.Size.X + e_s
  1122.         else
  1123.             texture.StudsPerTileU = obj.Size.X + e_s
  1124.         end
  1125.     elseif f == 'Front' or f == 'Back' then
  1126.         texture.StudsPerTileV = obj.Size.Y + e_s
  1127.         if (obj.Size.X > obj.Size.Z) then
  1128.             texture.StudsPerTileV = obj.Size.X + e_s
  1129.         elseif (obj.Size.Z > obj.Size.X) then
  1130.             texture.StudsPerTileU = obj.Size.Z + e_s
  1131.         else
  1132.             texture.StudsPerTileU = obj.Size.X + e_s
  1133.         end
  1134.     elseif f == 'Top' or f == 'Bottom' then
  1135.         texture.StudsPerTileV = obj.Size.X + e_s
  1136.         texture.StudsPerTileU = obj.Size.Z + e_s
  1137.     end
  1138.     end)
  1139. end
  1140.  
  1141. function add_blood(obj,t)
  1142.     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)]
  1143.     add_decal('Top',t1,obj,5,t)
  1144.     add_decal('Bottom',t2,obj,5,t)
  1145.     add_decal('Left',t3,obj,5,t)
  1146.     add_decal('Right',t4,obj,5,t)
  1147.     add_decal('Front',t5,obj,5,t)
  1148.     add_decal('Back',t6,obj,5,t)
  1149. end
  1150. function break_limb(obj,rig,targtorso,targhum,dir)
  1151.     if not obj:FindFirstChild('Dismembered') and obj.Name:lower() ~= 'torso' and obj.Name:lower() ~= 'humanoidrootpart' and obj.Name:lower() ~= 'uppertorso' and obj.Name:lower() ~= 'lowertorso' then else return end
  1152.     local confirm = Instance.new("ObjectValue")
  1153.     confirm.Name = 'Dismembered'
  1154.     confirm.Parent = obj
  1155.     if rig == Enum.HumanoidRigType.R6 then
  1156.         for i,v in pairs(targtorso:GetDescendants()) do
  1157.             if check_weld(v) then
  1158.                 if obj.Name == 'Head' and v.Name:lower() == 'neck' then
  1159.                     v:Destroy()
  1160.                 elseif obj.Name == 'Left Arm' and v.Name:lower() == 'left shoulder' then
  1161.                     v:Destroy()
  1162.                 elseif obj.Name == 'Right Arm' and v.Name:lower() == 'right shoulder' then
  1163.                     v:Destroy()
  1164.                 elseif obj.Name == 'Left Leg' and v.Name:lower() == 'left hip' then
  1165.                     if v:IsA("Motor6D") and obj.Parent:FindFirstChild("Right Leg") and not obj.Parent:FindFirstChild("Right Leg"):FindFirstChild("Dismembered") then
  1166.                         targhum.WalkSpeed = targhum.WalkSpeed/2
  1167.                     elseif v:IsA("Motor6D") then
  1168.                         targhum.WalkSpeed = 0
  1169.                     end
  1170.                     v:Destroy()
  1171.                 elseif obj.Name == 'Right Leg' and v.Name:lower() == 'right hip' then
  1172.                     if v:IsA("Motor6D") and obj.Parent:FindFirstChild("Left Leg") and not obj.Parent:FindFirstChild("Left Leg"):FindFirstChild("Dismembered") then
  1173.                         targhum.WalkSpeed = targhum.WalkSpeed/2
  1174.                     elseif v:IsA("Motor6D") then
  1175.                         targhum.WalkSpeed = 0
  1176.                     end
  1177.                     v:Destroy()
  1178.                 end
  1179.             end
  1180.         end
  1181.         for i,v in pairs(obj:GetChildren()) do
  1182.             if check_weld(v) then
  1183.                 if obj.Name == 'Left Leg' then
  1184.                     if v:IsA("Motor6D") and obj.Parent:FindFirstChild("Right Leg") and not obj.Parent:FindFirstChild("Right Leg"):FindFirstChild("Dismembered") then
  1185.                         targhum.WalkSpeed = targhum.WalkSpeed/2
  1186.                     elseif v:IsA("Motor6D") then
  1187.                         targhum.WalkSpeed = 0
  1188.                     end
  1189.                 elseif obj.Name == 'Right Leg' then
  1190.                     if v:IsA("Motor6D") and obj.Parent:FindFirstChild("Left Leg") and not obj.Parent:FindFirstChild("Left Leg"):FindFirstChild("Dismembered") then
  1191.                         targhum.WalkSpeed = targhum.WalkSpeed/2
  1192.                     elseif v:IsA("Motor6D") then
  1193.                         targhum.WalkSpeed = 0
  1194.                     end
  1195.                 end
  1196.                 v:Destroy()
  1197.             end
  1198.         end
  1199.     elseif rig == Enum.HumanoidRigType.R15 then
  1200.         for i,v in pairs(obj:GetChildren()) do
  1201.             if check_weld(v) then
  1202.                 if v:IsA("Motor6D") then
  1203.                     if v:IsA("Motor6D") and ((obj.Name == 'LeftUpperLeg' and obj.Parent:FindFirstChild("RightUpperLeg") and not obj.Parent:FindFirstChild("RightUpperLeg"):FindFirstChild("Dismembered")) or (obj.Name == 'RightUpperLeg' and obj.Parent:FindFirstChild("LeftUpperLeg") and not obj.Parent:FindFirstChild("LeftUpperLeg"):FindFirstChild("Dismembered"))) then
  1204.                         targhum.WalkSpeed = targhum.WalkSpeed/2
  1205.                     elseif v:IsA("Motor6D") and (obj.Name == 'RightUpperLeg' or obj.Name == 'LeftUpperLeg') then
  1206.                         targhum.WalkSpeed = 0
  1207.                     end
  1208.                 end
  1209.                 v:Destroy()
  1210.             end
  1211.         end
  1212.     end
  1213.     bleed2(obj,targhum,false,1,false)
  1214.     add_blood(obj)
  1215.     make_bone(obj,targtorso)
  1216.     local kb = 17
  1217.     local bv = Instance.new("BodyVelocity")
  1218.     bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1219.     bv.Velocity = dir*kb+Vector3.new(0,kb,0)
  1220.     bv.Parent = obj
  1221.     game:GetService("Debris"):AddItem(bv,0.1)
  1222.     limb_collide(obj,true)
  1223. end
  1224. function Ragdoll(targchar,headless,insta,kill)
  1225.     local pc = targchar
  1226.     local targhum = pc:FindFirstChild("Humanoid")
  1227.     local js,js2 = {},{}
  1228.     for _,obj in pairs(pc:GetDescendants()) do
  1229.         if obj:IsA("BasePart") or obj:IsA("UnionOperation") then
  1230.             obj.Massless = true
  1231.             obj.Locked = true
  1232.         end
  1233.     end
  1234.     if kill == true then
  1235.         pc.Archivable = true
  1236.         local old_pc = pc
  1237.         pc = pc:Clone()
  1238.         for i,v in pairs(pc:GetDescendants()) do
  1239.             limb_collide(v,true)
  1240.             if v:IsA("ParticleEmitter") then
  1241.                 v.Enabled = false
  1242.             end
  1243.             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
  1244.                 if v:IsA("BodyVelocity") then
  1245.                     game:GetService("Debris"):AddItem(v,0.15)
  1246.                 else
  1247.                     v:Destroy()
  1248.                 end
  1249.             end
  1250.             if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
  1251.                 v:Destroy()
  1252.             end
  1253.             if v:IsA("Humanoid") then
  1254.                 v.BreakJointsOnDeath = false
  1255.                 v.Health = 0
  1256.                 v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  1257.                 v.PlatformStand = true
  1258.             end
  1259.         end
  1260.         for i,v in pairs(old_pc:GetDescendants()) do
  1261.             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
  1262.                 v:destroy()
  1263.             end
  1264.             if v:IsA("Humanoid") then
  1265.                 v.BreakJointsOnDeath = true
  1266.                 v.Health = 0
  1267.                 v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  1268.                 v.PlatformStand = true
  1269.             end
  1270.         end
  1271.         pc.Parent = workspace
  1272.         game:GetService("Debris"):AddItem(pc,30)
  1273.     end
  1274.     --if kill and targhum:FindFirstChild("Ragdolled") then return; end;
  1275.     if pc ~= nil then
  1276.         local hum = pc:FindFirstChild'Humanoid'
  1277.         local LArm = pc:FindFirstChild'Left Arm'
  1278.         local RArm = pc:FindFirstChild'Right Arm'
  1279.         local LLeg = pc:FindFirstChild'Left Leg'
  1280.         local RLeg = pc:FindFirstChild'Right Leg'
  1281.         local torso = pc:FindFirstChild'Torso'
  1282.         local head = pc:FindFirstChild'Head'
  1283.        
  1284.        
  1285.         local LUA = pc:FindFirstChild'LeftUpperArm'
  1286.         local LLA = pc:FindFirstChild'LeftLowerArm'
  1287.         local LH = pc:FindFirstChild'LeftHand'
  1288.        
  1289.         local RUA = pc:FindFirstChild'RightUpperArm'
  1290.         local RLA = pc:FindFirstChild'RightLowerArm'
  1291.         local RH = pc:FindFirstChild'RightHand'
  1292.        
  1293.         local LUL = pc:FindFirstChild'LeftUpperLeg'
  1294.         local LLL = pc:FindFirstChild'LeftLowerLeg'
  1295.         local LF = pc:FindFirstChild'LeftFoot'
  1296.        
  1297.         local RUL = pc:FindFirstChild'RightUpperLeg'
  1298.         local RLL = pc:FindFirstChild'RightLowerLeg'
  1299.         local RF = pc:FindFirstChild'RightFoot'
  1300.        
  1301.         local UT = pc:FindFirstChild'UpperTorso'
  1302.         local LT = pc:FindFirstChild'LowerTorso'
  1303.        
  1304.         if hum and LArm and RArm and LLeg and RLeg and head then
  1305.             hum.BreakJointsOnDeath = false
  1306.             if insta then
  1307.                 if hum.RigType==Enum.HumanoidRigType.R6 then
  1308.                     for _,v in pairs(torso:GetDescendants()) do
  1309.                         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
  1310.                             if not kill then
  1311.                                 table.insert(js2,1,{obj = v,par = v.Parent})
  1312.                                 v.Parent = nil
  1313.                             elseif kill then
  1314.                                 v:Destroy()
  1315.                             end
  1316.                         end
  1317.                     end
  1318.                    local vis = false
  1319.                    local vis2 = false
  1320.                     if LArm and not LArm:FindFirstChild('Dismembered') then
  1321.                        local at1 = Instance.new("Attachment")
  1322.                        at1.Parent = torso
  1323.                        at1.Visible = vis
  1324.                        at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  1325.                        at1.Position = Vector3.new(-1,1,0)
  1326.                                        
  1327.                        local at1p2 = Instance.new("Attachment")
  1328.                        at1p2.Parent = LArm
  1329.                        at1p2.Visible = vis
  1330.                        at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  1331.                        at1p2.Position = Vector3.new(.5,1,0)
  1332.                            
  1333.                        local bis = Instance.new("BallSocketConstraint")
  1334.                        bis.Parent = LArm
  1335.                        bis.Attachment0 = at1
  1336.                        bis.Attachment1 = at1p2
  1337.                        bis.LimitsEnabled = true
  1338.                        bis.UpperAngle = 15
  1339.                        bis.Visible = vis2
  1340.                        bis.TwistLimitsEnabled = true
  1341.                        bis.UpperAngle = -45
  1342.                        bis.TwistLowerAngle = -45
  1343.                         table.insert(js,1,bis)
  1344.                     end
  1345.                     if RArm and not RArm:FindFirstChild('Dismembered') then    
  1346.                         local at2 = Instance.new("Attachment")
  1347.                         at2.Parent = torso
  1348.                         at2.Visible = vis
  1349.                         at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  1350.                         at2.Position = Vector3.new(1,1,0)
  1351.                                
  1352.                         local at2p2 = Instance.new("Attachment")
  1353.                         at2p2.Parent = RArm
  1354.                         at2p2.Visible = vis
  1355.                         at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  1356.                         at2p2.Position = Vector3.new(-.5,1,0)
  1357.                        
  1358.                         local bis2 = Instance.new("BallSocketConstraint")
  1359.                         bis2.Parent = RArm
  1360.                         bis2.Attachment0 = at2
  1361.                         bis2.Attachment1 = at2p2
  1362.                         bis2.LimitsEnabled = true
  1363.                         bis2.UpperAngle = 15
  1364.                         bis2.Visible = vis2
  1365.                         bis2.TwistLimitsEnabled = true
  1366.                         bis2.UpperAngle = -45
  1367.                         bis2.TwistLowerAngle = -45
  1368.                         table.insert(js,1,bis2)
  1369.                     end
  1370.                      if RLeg and not RLeg:FindFirstChild('Dismembered') then
  1371.                         local at3 = Instance.new("Attachment")
  1372.                         at3.Parent = torso
  1373.                         at3.Visible = vis
  1374.                         at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  1375.                         at3.Position = Vector3.new(.5,-1,0)
  1376.                                
  1377.                         local at3p2 = Instance.new("Attachment")
  1378.                         at3p2.Parent = RLeg
  1379.                         at3p2.Visible = vis
  1380.                         at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  1381.                         at3p2.Position = Vector3.new(0,1,0)
  1382.                        
  1383.                         local bis3 = Instance.new("BallSocketConstraint")
  1384.                         bis3.Parent = RLeg
  1385.                         bis3.Attachment0 = at3
  1386.                         bis3.Attachment1 = at3p2
  1387.                         bis3.LimitsEnabled = true
  1388.                         bis3.UpperAngle = 180-15
  1389.                         bis3.Visible = vis2
  1390.                         table.insert(js,1,bis3)
  1391.                     end
  1392.                          
  1393.                     if LLeg and not LLeg:FindFirstChild('Dismembered') then  
  1394.                         local at4 = Instance.new("Attachment")
  1395.                         at4.Parent = torso
  1396.                         at4.Visible = vis
  1397.                         at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  1398.                         at4.Position = Vector3.new(-.5,-1,0)
  1399.                                
  1400.                         local at4p2 = Instance.new("Attachment")
  1401.                         at4p2.Parent = LLeg
  1402.                         at4p2.Visible = vis
  1403.                         at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  1404.                         at4p2.Position = Vector3.new(0,1,0)
  1405.                    
  1406.                         local bis4 = Instance.new("BallSocketConstraint")
  1407.                         bis4.Parent = LLeg
  1408.                         bis4.Attachment0 = at4
  1409.                         bis4.Attachment1 = at4p2
  1410.                         bis4.LimitsEnabled = true
  1411.                         bis4.UpperAngle = 180-15
  1412.                         bis4.Visible = vis2
  1413.                         table.insert(js,1,bis4)
  1414.                     end
  1415.                    
  1416.                     if head and not headless and not head:FindFirstChild('Dismembered') then  
  1417.                             local at5 = Instance.new("Attachment")
  1418.                             at5.Parent = torso
  1419.                             at5.Visible = vis
  1420.                             at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  1421.                             at5.Position = Vector3.new(0,1,0)
  1422.                          
  1423.                             local at5p2 = Instance.new("Attachment")
  1424.                             at5p2.Parent = head
  1425.                             at5p2.Visible = vis
  1426.                             at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  1427.                             at5p2.Position = Vector3.new(0,-.5,0)
  1428.                    
  1429.                             local bis5 = Instance.new("BallSocketConstraint")
  1430.                             bis5.Parent = head
  1431.                             bis5.Attachment0 = at5p2
  1432.                             bis5.Attachment1 = at5
  1433.                             bis5.LimitsEnabled = true
  1434.                             bis5.UpperAngle = 75
  1435.                             bis5.Visible = vis2
  1436.                             bis5.TwistLimitsEnabled = true
  1437.                             bis5.UpperAngle = -45
  1438.                             bis5.TwistLowerAngle = -45
  1439.                             table.insert(js,1,bis5)
  1440.                         else
  1441.                             --head:BreakJoints()
  1442.                         end
  1443.                     end
  1444.             else
  1445.                 hum.Died:Connect(function()
  1446.                 if hum.RigType==Enum.HumanoidRigType.R6 then
  1447.                     for _,v in pairs(torso:GetDescendants()) do
  1448.                         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
  1449.                             if not kill then
  1450.                                 table.insert(js2,1,{obj = v,par = v.Parent})
  1451.                                 v.Parent = nil
  1452.                             elseif kill then
  1453.                                 v:Destroy()
  1454.                             end
  1455.                         end
  1456.                     end
  1457.                    local vis = false
  1458.                    local vis2 = false
  1459.                     if LArm and not LArm:FindFirstChild('Dismembered') then
  1460.                        local at1 = Instance.new("Attachment")
  1461.                        at1.Parent = torso
  1462.                        at1.Visible = vis
  1463.                        at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  1464.                        at1.Position = Vector3.new(-1,1,0)
  1465.                                        
  1466.                        local at1p2 = Instance.new("Attachment")
  1467.                        at1p2.Parent = LArm
  1468.                        at1p2.Visible = vis
  1469.                        at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  1470.                        at1p2.Position = Vector3.new(.5,1,0)
  1471.                            
  1472.                        local bis = Instance.new("BallSocketConstraint")
  1473.                        bis.Parent = LArm
  1474.                        bis.Attachment0 = at1
  1475.                        bis.Attachment1 = at1p2
  1476.                        bis.LimitsEnabled = true
  1477.                        bis.UpperAngle = 15
  1478.                        bis.Visible = vis2
  1479.                        bis.TwistLimitsEnabled = true
  1480.                        bis.UpperAngle = -45
  1481.                        bis.TwistLowerAngle = -45
  1482.                         table.insert(js,1,bis)
  1483.                     end
  1484.                     if RArm and not RArm:FindFirstChild('Dismembered') then    
  1485.                         local at2 = Instance.new("Attachment")
  1486.                         at2.Parent = torso
  1487.                         at2.Visible = vis
  1488.                         at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  1489.                         at2.Position = Vector3.new(1,1,0)
  1490.                                
  1491.                         local at2p2 = Instance.new("Attachment")
  1492.                         at2p2.Parent = RArm
  1493.                         at2p2.Visible = vis
  1494.                         at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  1495.                         at2p2.Position = Vector3.new(-.5,1,0)
  1496.                        
  1497.                         local bis2 = Instance.new("BallSocketConstraint")
  1498.                         bis2.Parent = RArm
  1499.                         bis2.Attachment0 = at2
  1500.                         bis2.Attachment1 = at2p2
  1501.                         bis2.LimitsEnabled = true
  1502.                         bis2.UpperAngle = 15
  1503.                         bis2.Visible = vis2
  1504.                         bis2.TwistLimitsEnabled = true
  1505.                         bis2.UpperAngle = -45
  1506.                         bis2.TwistLowerAngle = -45
  1507.                         table.insert(js,1,bis2)
  1508.                     end
  1509.                      if RLeg and not RLeg:FindFirstChild('Dismembered') then
  1510.                         local at3 = Instance.new("Attachment")
  1511.                         at3.Parent = torso
  1512.                         at3.Visible = vis
  1513.                         at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  1514.                         at3.Position = Vector3.new(.5,-1,0)
  1515.                                
  1516.                         local at3p2 = Instance.new("Attachment")
  1517.                         at3p2.Parent = RLeg
  1518.                         at3p2.Visible = vis
  1519.                         at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  1520.                         at3p2.Position = Vector3.new(0,1,0)
  1521.                        
  1522.                         local bis3 = Instance.new("BallSocketConstraint")
  1523.                         bis3.Parent = RLeg
  1524.                         bis3.Attachment0 = at3
  1525.                         bis3.Attachment1 = at3p2
  1526.                         bis3.LimitsEnabled = true
  1527.                         bis3.UpperAngle = 180-15
  1528.                         bis3.Visible = vis2
  1529.                         table.insert(js,1,bis3)
  1530.                     end
  1531.                          
  1532.                     if LLeg and not LLeg:FindFirstChild('Dismembered') then  
  1533.                         local at4 = Instance.new("Attachment")
  1534.                         at4.Parent = torso
  1535.                         at4.Visible = vis
  1536.                         at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  1537.                         at4.Position = Vector3.new(-.5,-1,0)
  1538.                                
  1539.                         local at4p2 = Instance.new("Attachment")
  1540.                         at4p2.Parent = LLeg
  1541.                         at4p2.Visible = vis
  1542.                         at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  1543.                         at4p2.Position = Vector3.new(0,1,0)
  1544.                    
  1545.                         local bis4 = Instance.new("BallSocketConstraint")
  1546.                         bis4.Parent = LLeg
  1547.                         bis4.Attachment0 = at4
  1548.                         bis4.Attachment1 = at4p2
  1549.                         bis4.LimitsEnabled = true
  1550.                         bis4.UpperAngle = 180-15
  1551.                         bis4.Visible = vis2
  1552.                         table.insert(js,1,bis4)
  1553.                     end
  1554.                    
  1555.                     if head and not headless and not head:FindFirstChild('Dismembered') then  
  1556.                             local at5 = Instance.new("Attachment")
  1557.                             at5.Parent = torso
  1558.                             at5.Visible = vis
  1559.                             at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  1560.                             at5.Position = Vector3.new(0,1,0)
  1561.                          
  1562.                             local at5p2 = Instance.new("Attachment")
  1563.                             at5p2.Parent = head
  1564.                             at5p2.Visible = vis
  1565.                             at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  1566.                             at5p2.Position = Vector3.new(0,-.5,0)
  1567.                    
  1568.                             local bis5 = Instance.new("BallSocketConstraint")
  1569.                             bis5.Parent = head
  1570.                             bis5.Attachment0 = at5p2
  1571.                             bis5.Attachment1 = at5
  1572.                             bis5.LimitsEnabled = true
  1573.                             bis5.UpperAngle = 75
  1574.                             bis5.Visible = vis2
  1575.                             bis5.TwistLimitsEnabled = true
  1576.                             bis5.UpperAngle = -45
  1577.                             bis5.TwistLowerAngle = -45
  1578.                             table.insert(js,1,bis5)
  1579.                         else
  1580.                             --head:BreakJoints()
  1581.                         end
  1582.                     end
  1583.                 end)
  1584.             end
  1585.         elseif head and hum then
  1586.             hum.BreakJointsOnDeath = false
  1587.             if insta then
  1588.                 if hum.RigType==Enum.HumanoidRigType.R15 then
  1589.                     for _,v in pairs(pc:GetDescendants()) do
  1590.                         if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  1591.                             if not kill then
  1592.                                 table.insert(js2,1,{obj = v,par = v.Parent})
  1593.                                 v.Parent = nil
  1594.                             elseif kill then
  1595.                                 v:Destroy()
  1596.                             end
  1597.                         end
  1598.                     end
  1599.                     local vis = false
  1600.                     local vis2 = false
  1601.                        
  1602.                     if LF and not LF:FindFirstChild('Dismembered') then  
  1603.                         local bsc1 = Instance.new("BallSocketConstraint",LF)
  1604.                         bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  1605.                         bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  1606.                         table.insert(js,1,bsc1)
  1607.                     end
  1608.                     if LLL and not LLL:FindFirstChild('Dismembered') then  
  1609.                         local bsc2 = Instance.new("BallSocketConstraint",LLL)
  1610.                         bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  1611.                         bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  1612.                         table.insert(js,1,bsc2)
  1613.                     end
  1614.                     if LUL and not LUL:FindFirstChild('Dismembered') then  
  1615.                         local bsc3 = Instance.new("BallSocketConstraint",LUL)
  1616.                         bsc3.Attachment0 = LUL.LeftHipRigAttachment
  1617.                         bsc3.Attachment1 = LT.LeftHipRigAttachment
  1618.                         table.insert(js,1,bsc3)
  1619.                     end
  1620.                     if RF and not RF:FindFirstChild('Dismembered') then  
  1621.                         local bsc4 = Instance.new("BallSocketConstraint",RF)
  1622.                         bsc4.Attachment0 = RF.RightAnkleRigAttachment
  1623.                         bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  1624.                         table.insert(js,1,bsc4)
  1625.                     end
  1626.                     if RLL and not RLL:FindFirstChild('Dismembered') then  
  1627.                         local bsc5 = Instance.new("BallSocketConstraint",RLL)
  1628.                         bsc5.Attachment0 = RLL.RightKneeRigAttachment
  1629.                         bsc5.Attachment1 = RUL.RightKneeRigAttachment
  1630.                         table.insert(js,1,bsc5)
  1631.                     end
  1632.                     if RUL and not RUL:FindFirstChild('Dismembered') then  
  1633.                         local bsc6 = Instance.new("BallSocketConstraint",RUL)
  1634.                         bsc6.Attachment0 = RUL.RightHipRigAttachment
  1635.                         bsc6.Attachment1 = LT.RightHipRigAttachment
  1636.                         table.insert(js,1,bsc6)
  1637.                     end
  1638.                     if LH and not LH:FindFirstChild('Dismembered') then  
  1639.                         local bsc7 = Instance.new("BallSocketConstraint",LH)
  1640.                         bsc7.Attachment0 = LH.LeftWristRigAttachment
  1641.                         bsc7.Attachment1 = LLA.LeftWristRigAttachment
  1642.                         table.insert(js,1,bsc7)
  1643.                     end
  1644.                     if LLA and not LLA:FindFirstChild('Dismembered') then  
  1645.                         local bsc8 = Instance.new("BallSocketConstraint",LLA)
  1646.                         bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  1647.                         bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  1648.                         table.insert(js,1,bsc8)
  1649.                     end
  1650.                     if LUA and not LUA:FindFirstChild('Dismembered') then  
  1651.                         local bsc9 = Instance.new("BallSocketConstraint",LUA)
  1652.                         bsc9.Attachment0 = LUA.LeftShoulderAttachment
  1653.                         bsc9.Attachment1 = UT.LeftCollarAttachment
  1654.                         table.insert(js,1,bsc9)
  1655.                     end
  1656.                     if RH and not RH:FindFirstChild('Dismembered') then  
  1657.                         local bsc10 = Instance.new("BallSocketConstraint",RH)
  1658.                         bsc10.Attachment0 = RH.RightWristRigAttachment
  1659.                         bsc10.Attachment1 = RLA.RightWristRigAttachment
  1660.                         table.insert(js,1,bsc10)
  1661.                     end
  1662.                     if RLA and not RLA:FindFirstChild('Dismembered') then  
  1663.                         local bsc11 = Instance.new("BallSocketConstraint",RLA)
  1664.                         bsc11.Attachment0 = RLA.RightElbowRigAttachment
  1665.                         bsc11.Attachment1 = RUA.RightElbowRigAttachment
  1666.                         table.insert(js,1,bsc11)
  1667.                     end
  1668.                     if RUA and not RUA:FindFirstChild('Dismembered') then  
  1669.                         local bsc12 = Instance.new("BallSocketConstraint",RUA)
  1670.                         bsc12.Attachment0 = RUA.RightShoulderAttachment
  1671.                         bsc12.Attachment1 = UT.RightCollarAttachment
  1672.                         table.insert(js,1,bsc12)
  1673.                     end
  1674.                     if LT and not LT:FindFirstChild('Dismembered') then  
  1675.                         local bsc13 = Instance.new("BallSocketConstraint",LT)
  1676.                         bsc13.Attachment0 = LT.WaistRigAttachment
  1677.                         bsc13.Attachment1 = UT.WaistRigAttachment
  1678.                         table.insert(js,1,bsc13)
  1679.                     end
  1680.                     if head and not headless and not head:FindFirstChild('Dismembered')  then
  1681.                         local bsc14 = Instance.new("BallSocketConstraint",head)
  1682.                         bsc14.Attachment0 = UT.NeckRigAttachment
  1683.                         bsc14.Attachment1 = head.NeckRigAttachment
  1684.                         bsc14.LimitsEnabled = true
  1685.                         bsc14.UpperAngle = -75
  1686.                         bsc14.TwistLimitsEnabled = true
  1687.                         bsc14.UpperAngle = -45
  1688.                         bsc14.TwistLowerAngle = -45
  1689.                         table.insert(js,1,bsc14)
  1690.                     else
  1691.                         --head:BreakJoints()
  1692.                     end
  1693.                 end
  1694.             else
  1695.                 hum.Died:Connect(function()
  1696.                     if hum.RigType==Enum.HumanoidRigType.R15 then
  1697.                         for _,v in pairs(pc:GetDescendants()) do
  1698.                             if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  1699.                                 if not kill then
  1700.                                     table.insert(js2,1,{obj = v,par = v.Parent})
  1701.                                     v.Parent = nil
  1702.                                 elseif kill then
  1703.                                     v:Destroy()
  1704.                                 end
  1705.                             end
  1706.                         end
  1707.                         local vis = false
  1708.                         local vis2 = false
  1709.                            
  1710.                         if LF and not LF:FindFirstChild('Dismembered') then  
  1711.                             local bsc1 = Instance.new("BallSocketConstraint",LF)
  1712.                             bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  1713.                             bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  1714.                             table.insert(js,1,bsc1)
  1715.                         end
  1716.                         if LLL and not LLL:FindFirstChild('Dismembered') then  
  1717.                             local bsc2 = Instance.new("BallSocketConstraint",LLL)
  1718.                             bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  1719.                             bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  1720.                             table.insert(js,1,bsc2)
  1721.                         end
  1722.                         if LUL and not LUL:FindFirstChild('Dismembered') then  
  1723.                             local bsc3 = Instance.new("BallSocketConstraint",LUL)
  1724.                             bsc3.Attachment0 = LUL.LeftHipRigAttachment
  1725.                             bsc3.Attachment1 = LT.LeftHipRigAttachment
  1726.                             table.insert(js,1,bsc3)
  1727.                         end
  1728.                         if RF and not RF:FindFirstChild('Dismembered') then  
  1729.                             local bsc4 = Instance.new("BallSocketConstraint",RF)
  1730.                             bsc4.Attachment0 = RF.RightAnkleRigAttachment
  1731.                             bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  1732.                             table.insert(js,1,bsc4)
  1733.                         end
  1734.                         if RLL and not RLL:FindFirstChild('Dismembered') then  
  1735.                             local bsc5 = Instance.new("BallSocketConstraint",RLL)
  1736.                             bsc5.Attachment0 = RLL.RightKneeRigAttachment
  1737.                             bsc5.Attachment1 = RUL.RightKneeRigAttachment
  1738.                             table.insert(js,1,bsc5)
  1739.                         end
  1740.                         if RUL and not RUL:FindFirstChild('Dismembered') then  
  1741.                             local bsc6 = Instance.new("BallSocketConstraint",RUL)
  1742.                             bsc6.Attachment0 = RUL.RightHipRigAttachment
  1743.                             bsc6.Attachment1 = LT.RightHipRigAttachment
  1744.                             table.insert(js,1,bsc6)
  1745.                         end
  1746.                         if LH and not LH:FindFirstChild('Dismembered') then  
  1747.                             local bsc7 = Instance.new("BallSocketConstraint",LH)
  1748.                             bsc7.Attachment0 = LH.LeftWristRigAttachment
  1749.                             bsc7.Attachment1 = LLA.LeftWristRigAttachment
  1750.                             table.insert(js,1,bsc7)
  1751.                         end
  1752.                         if LLA and not LLA:FindFirstChild('Dismembered') then  
  1753.                             local bsc8 = Instance.new("BallSocketConstraint",LLA)
  1754.                             bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  1755.                             bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  1756.                             table.insert(js,1,bsc8)
  1757.                         end
  1758.                         if LUA and not LUA:FindFirstChild('Dismembered') then  
  1759.                             local bsc9 = Instance.new("BallSocketConstraint",LUA)
  1760.                             bsc9.Attachment0 = LUA.LeftShoulderAttachment
  1761.                             bsc9.Attachment1 = UT.LeftCollarAttachment
  1762.                             table.insert(js,1,bsc9)
  1763.                         end
  1764.                         if RH and not RH:FindFirstChild('Dismembered') then  
  1765.                             local bsc10 = Instance.new("BallSocketConstraint",RH)
  1766.                             bsc10.Attachment0 = RH.RightWristRigAttachment
  1767.                             bsc10.Attachment1 = RLA.RightWristRigAttachment
  1768.                             table.insert(js,1,bsc10)
  1769.                         end
  1770.                         if RLA and not RLA:FindFirstChild('Dismembered') then  
  1771.                             local bsc11 = Instance.new("BallSocketConstraint",RLA)
  1772.                             bsc11.Attachment0 = RLA.RightElbowRigAttachment
  1773.                             bsc11.Attachment1 = RUA.RightElbowRigAttachment
  1774.                             table.insert(js,1,bsc11)
  1775.                         end
  1776.                         if RUA and not RUA:FindFirstChild('Dismembered') then  
  1777.                             local bsc12 = Instance.new("BallSocketConstraint",RUA)
  1778.                             bsc12.Attachment0 = RUA.RightShoulderAttachment
  1779.                             bsc12.Attachment1 = UT.RightCollarAttachment
  1780.                             table.insert(js,1,bsc12)
  1781.                         end
  1782.                         if LT and not LT:FindFirstChild('Dismembered') then  
  1783.                             local bsc13 = Instance.new("BallSocketConstraint",LT)
  1784.                             bsc13.Attachment0 = LT.WaistRigAttachment
  1785.                             bsc13.Attachment1 = UT.WaistRigAttachment
  1786.                             table.insert(js,1,bsc13)
  1787.                         end
  1788.                         if head and not headless and not head:FindFirstChild('Dismembered')  then
  1789.                             local bsc14 = Instance.new("BallSocketConstraint",head)
  1790.                             bsc14.Attachment0 = UT.NeckRigAttachment
  1791.                             bsc14.Attachment1 = head.NeckRigAttachment
  1792.                             bsc14.LimitsEnabled = true
  1793.                             bsc14.UpperAngle = -75
  1794.                             bsc14.TwistLimitsEnabled = true
  1795.                             bsc14.UpperAngle = -45
  1796.                             bsc14.TwistLowerAngle = -45
  1797.                             table.insert(js,1,bsc14)
  1798.                         else
  1799.                             --head:BreakJoints()
  1800.                         end
  1801.                     end
  1802.                 end)
  1803.             end
  1804.         end
  1805.     end
  1806.     return js,js2
  1807. end
  1808. function Damage(obj)
  1809.     local targchar,targtorso,targhum,killval,hitval
  1810.     pcall(function()
  1811.         targchar = obj.Parent
  1812.     end)
  1813.     for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  1814.         if v and v.Character and obj:IsDescendantOf(v.Character) then
  1815.             targchar = v.Character
  1816.         end
  1817.     end
  1818.     pcall(function()
  1819.         targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso")
  1820.     end)
  1821.     pcall(function()
  1822.         targrootpart = targchar:FindFirstChild("HumanoidRootPart")
  1823.     end)
  1824.     pcall(function()
  1825.         targhum = targchar:FindFirstChildOfClass("Humanoid")
  1826.     end)
  1827.     pcall(function()
  1828.         killval = targhum:FindFirstChild("killer")
  1829.     end)
  1830.     pcall(function()
  1831.         hitval = targhum:FindFirstChild("hit " .. targchar.Name .. " with balisong by " .. plr.Name)
  1832.     end)
  1833.     if targchar and targhum and targhum ~= hum and hum and hum.Health > 0 and not killval and not hitval and equipped and stabbing then
  1834.         local temphitval = Instance.new("ObjectValue",targhum)
  1835.         temphitval.Name = ("hit " .. targchar.Name .. " with balisong by " .. plr.Name)
  1836.         game:GetService("Debris"):AddItem(temphitval,wait_time)
  1837.         local distance = (rootpart or torso).Position-(targrootpart or targtorso).Position
  1838.         local direction = distance/distance.magnitude
  1839.         local dp = direction:Dot(targtorso.CFrame.lookVector)
  1840.         if targhum.Health > 0 then
  1841.             if -0.6 > dp then  
  1842.                 targhum:TakeDamage(1/0)
  1843.             else
  1844.                 targhum:TakeDamage(math.random(15,25))
  1845.             end
  1846.             add_blood(obj)
  1847.             stab_s.SoundId = 'rbxassetid://' .. stabs[math.random(1,#stabs)]
  1848.             stab_s:Play()
  1849.         end
  1850.         if 0 >= targhum.Health then
  1851.             local tempkillval = Instance.new("ObjectValue",targhum)
  1852.             tempkillval.Name = "killer"
  1853.             tempkillval.Value = plr
  1854.             local v = 15
  1855.             local bv = Instance.new("BodyVelocity")
  1856.             bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1857.             bv.Velocity = (rootpart or torso).CFrame.lookVector*v
  1858.             bv.Parent = targtorso
  1859.             game:GetService("Debris"):AddItem(bv,0.15)
  1860.             pcall(function()
  1861.                 Ragdoll(targchar,false,true,true)
  1862.             end)
  1863.         end
  1864.         bleed2(targtorso or targrootpart,targhum,true,3,false)
  1865.     end
  1866. end
  1867. local oid = 0
  1868. function open()
  1869.     spawn(function()
  1870.     opening = true
  1871.     local coid = oid + 1
  1872.     oid = coid
  1873.     knife.Grip = grip*CFrame.new(0,1,0)*CFrame.Angles(math.rad(180),0,0)
  1874.     hw.C0 = CFrame.Angles(0,0,math.rad(-178.2))
  1875.     bw.C0 = CFrame.Angles(0,0,math.rad(178.2))
  1876.     lw.C0 = CFrame.Angles(0,0,math.rad(178.2))
  1877.     wait(0.1)
  1878.     k_trail.Enabled = true
  1879.     local m = 15
  1880.     local d = 22/m
  1881.     local di1,di2
  1882.     if math.random(1,2) == 1 then
  1883.         di1 = 1
  1884.     else
  1885.         di1 = -1
  1886.     end
  1887.     if math.random(1,2) == 1 then
  1888.         di2 = 1
  1889.     else
  1890.         di2 = -1
  1891.     end
  1892.     if coid ~= oid then return end
  1893.     for i = 1,m do
  1894.         --knife.Grip = grip*CFrame.new(0,1-(i/m),0)*CFrame.Angles(math.rad(180),0,0)*CFrame.Angles(math.rad(-i*8.1*d),math.rad(i*8.1*d*2*di1),math.rad(i*8.1*d*2*di2))
  1895.         --hw.C0 = CFrame.Angles(0,0,math.rad(-178.2))*CFrame.Angles(0,0,math.rad(i*8.1*d))
  1896.         --bw.C0 = CFrame.Angles(0,0,math.rad(178.2))*CFrame.Angles(0,0,math.rad(-i*8.1*d))
  1897.         --lw.C0 = CFrame.Angles(0,0,math.rad(178.2))*CFrame.Angles(0,0,math.rad(-i*8.1*d))
  1898.         game:GetService("TweenService"):Create(knife,TweenInfo.new(0.1),{Grip = grip*CFrame.new(0,1-(i/m),0)*CFrame.Angles(math.rad(180),0,0)*CFrame.Angles(math.rad(-i*8.1*d),math.rad(i*8.1*d*2*di1),math.rad(i*8.1*d*2*di2))}):Play()
  1899.         game:GetService("TweenService"):Create(hw,TweenInfo.new(0.1),{C0 = CFrame.Angles(0,0,math.rad(-178.2))*CFrame.Angles(0,0,math.rad(i*8.1*d))}):Play()
  1900.         game:GetService("TweenService"):Create(bw,TweenInfo.new(0.1),{C0 = CFrame.Angles(0,0,math.rad(178.2))*CFrame.Angles(0,0,math.rad(-i*8.1*d))}):Play()
  1901.         game:GetService("TweenService"):Create(lw,TweenInfo.new(0.1),{C0 = CFrame.Angles(0,0,math.rad(178.2))*CFrame.Angles(0,0,math.rad(-i*8.1*d))}):Play()
  1902.         if coid ~= oid then break end
  1903.         wait()
  1904.     end
  1905.     if coid ~= oid then return end
  1906.     k_trail.Enabled = false
  1907.     opening = false
  1908.     end)
  1909. end
  1910. function close()
  1911.     local coid = oid + 1
  1912.     oid = coid
  1913.     knife.Grip = grip*CFrame.new(0,1,0)*CFrame.Angles(math.rad(180),0,0)
  1914.     hw.C0 = CFrame.Angles(0,0,math.rad(-178.2))
  1915.     bw.C0 = CFrame.Angles(0,0,math.rad(178.2))
  1916.     lw.C0 = CFrame.Angles(0,0,math.rad(178.2))
  1917.     k_trail.Enabled = false
  1918.     if coid ~= oid then return end
  1919. end
  1920.  
  1921. function Attack()
  1922.     if not stabbing and equipped and not opening then else return end
  1923.     stabbing = true
  1924.     k_trail.Enabled = true
  1925.     Animate('attack')
  1926.     swing_s:Play()
  1927.     wait(wait_time)
  1928.     game:GetService("TweenService"):Create(knife,TweenInfo.new(0.2),{Grip = grip}):Play()
  1929.     k_trail.Enabled = false
  1930.     stabbing = false
  1931.     hit_wall = false
  1932. end
  1933.  
  1934. function Animate(mode)
  1935.     if mode == 'attack' then
  1936.         animval = animval + 1
  1937.         if animval > #swing_anims then animval = 1 end
  1938.         swing_animation.AnimationId = "rbxassetid://" .. swing_anims[animval]
  1939.         swing_anim = hum:LoadAnimation(swing_animation)
  1940.         --[[
  1941.         if animval == 1 then
  1942.             swing_anim:Play(.05,2,1+wait_time/2) -- front swing
  1943.         else
  1944.         ]]
  1945.         if animval == 1 then
  1946.             game:GetService("TweenService"):Create(knife,TweenInfo.new(0.2),{Grip = CFrame.new(-0.414838791, 0.0478739329, -0.00762927299, 1, 3.55271368e-15, -4.37113847e-08, 4.37113847e-08, 1.91068525e-15, 0.999999881, -3.55271368e-15, -0.99999994, 1.91068525e-15)}):Play()
  1947.             swing_anim:Play(.3,1.5,1.2+(1-wait_time)) -- left swing
  1948.         elseif animval == 2 then
  1949.             swing_anim:Play(.3,1.5,1+(1-wait_time)) -- right swing 2
  1950.         elseif animval == 3 then
  1951.             swing_anim:Play(.3,1.5,1+(1-wait_time)) -- left swing 2
  1952.         elseif animval == 4 then
  1953.             swing_anim:Play(.3,1.5,1+(1-wait_time)) -- right swing
  1954.         end
  1955.     end
  1956. end
  1957.  
  1958. spawn(function()
  1959.     while wait(0.1) do
  1960.         for i,v in pairs(bloodlol_t) do
  1961.             if v then
  1962.                 if v.Transparency < 1 then
  1963.                     v.Transparency = v.Transparency + 0.05
  1964.                 else
  1965.                     v:Destroy()
  1966.                 end
  1967.             end
  1968.         end
  1969.     end
  1970. end)
  1971.  
  1972. function alive()
  1973.     local alive = false
  1974.     if (plr and plr.Parent and char and char.Parent and hum and hum.Parent and hum.Health > 0 and torso and torso.Parent) then
  1975.         alive = true
  1976.     end
  1977.     return alive
  1978. end
  1979.  
  1980. function breakwindow(hit)
  1981.     if hit and not string.match(hit.Name:lower(),"window shatter") and not string.match(hit.Name:lower(),"blood") then else return end
  1982.     wbreak.TimePosition = 0.1
  1983.     wbreak:Play()
  1984.     local sx,sy,sz=hit.Size.x,hit.Size.y,hit.Size.z
  1985.     hit.Name = "window shatter"
  1986.     for x=1,4 do
  1987.         for y=1,4 do
  1988.             local part=hit:Clone()
  1989.             local position=Vector3.new(x-2.1,y-2.1,0)*Vector3.new(sx/4,sy/4,sz)
  1990.             part.Size=Vector3.new(sx/4,sy/4,sz)
  1991.             part.CFrame=hit.CFrame*(CFrame.new(part.Size/8)-hit.Size/8+position)           
  1992.             part.Velocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  1993.             part.Name="window shatter"
  1994.             part.Parent=hit.Parent
  1995.             game:GetService("Debris"):AddItem(part,2)
  1996.             spawn(function()
  1997.                 wait(0.5)
  1998.                 for i=1,10 do
  1999.                     part.Transparency=part.Transparency+0.05
  2000.                     wait(0.05)
  2001.                 end
  2002.                 part:Destroy()
  2003.             end)
  2004.             part.Anchored=false
  2005.         end
  2006.     end
  2007.     hit:Destroy()
  2008. end
  2009.  
  2010. function decide(obj)
  2011.     local targpar,targhum,killval,hitval,hitval2
  2012.     pcall(function()
  2013.         targpar = obj.Parent
  2014.     end)
  2015.     pcall(function()
  2016.         targhum = obj.Parent:FindFirstChildOfClass("Humanoid")
  2017.     end)
  2018.     pcall(function()
  2019.         killval = targhum:FindFirstChild("killer")
  2020.     end)
  2021.     pcall(function()
  2022.         hitval = targhum:FindFirstChild("hit " .. targpar.Name .. " with balisong by " .. plr.Name)
  2023.     end)
  2024.     pcall(function()
  2025.         hitval2 = targpar:FindFirstChild("hit with balisong by " .. plr.Name)
  2026.     end)
  2027.    
  2028.     if targpar and stabbing and targhum and targhum.Health > 0 and not killval and not hitval then
  2029.         Damage(obj)
  2030.     elseif 1 > obj.Transparency and targpar and not hit_wall and stabbing and not targhum and not killval and not hitval and not hitval2 and not obj:FindFirstChild("Dismembered") and not obj.Parent:IsA("Tool") and not obj.Parent:IsA("Accessory") and obj.Parent.Name ~= 'Handle' and not string.match(obj.Name:lower(),'blood') and not string.match(obj.Name:lower(),'bullet') and not string.match(obj.Name:lower(),'limb') then
  2031.         hit_wall = true
  2032.         local tempval = Instance.new("ObjectValue")
  2033.         tempval.Name = ("hit " .. targpar.Name .. " with balisong by " .. plr.Name)
  2034.         tempval.Parent = targpar
  2035.         hitwall.SoundId = 'rbxassetid://' .. wallhits[math.random(1,#wallhits)]
  2036.         hitwall:Play()
  2037.         spark.Enabled = true
  2038.         spawn(function()
  2039.             wait(0.1)
  2040.             spark.Enabled = false
  2041.         end)
  2042.         if (obj.Material == Enum.Material.Glass or obj.Material == Enum.Material.Ice) then
  2043.             breakwindow(obj)
  2044.         end
  2045.     end
  2046. end
  2047.  
  2048. knife.Equipped:Connect(function()
  2049.     char = knife.Parent
  2050.     plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  2051.     hum = char:FindFirstChildOfClass("Humanoid")
  2052.     torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  2053.     rootpart = char:FindFirstChild("HumanoidRootPart")
  2054.     larm,rarm,lleg,rleg,head = char:FindFirstChild("Left Arm"),char:FindFirstChild("Right Arm"),char:FindFirstChild("Left Leg"),char:FindFirstChild("Right Leg"),char:FindFirstChild("Head")
  2055.     if alive() then else knife.Parent = workspace; return; end;
  2056.     equip_s:Play()
  2057.     idleanim = hum:LoadAnimation(idleanimation)
  2058.     idleanim:Play()
  2059.     equipped = true
  2060.     open()
  2061. end)
  2062.  
  2063. knife.Unequipped:Connect(function()
  2064.     equipped = false
  2065.     idleanim:Stop()
  2066.     swing_anim:Stop()
  2067.     close()
  2068. end)
  2069.  
  2070. knife.Activated:Connect(Attack)
  2071. blade.Touched:Connect(decide)
  2072.  
  2073. warn([[
  2074.     == KrY's Balisong v2.2 ==
  2075.     == Controls ==
  2076.     - Click to stab (backstabs do insta kill
  2077.     == Features ==
  2078.     - up to 9 skins made
  2079.     - Random skins applied when script ran
  2080.     - You can hit walls to create a sound and spark
  2081.     - Can break glass and ice materials
  2082.     - Balisong equip animation
  2083.     == Soon ==
  2084.     - more Balisong animations? lol
  2085. ]])
Add Comment
Please, Sign In to add comment