Advertisement
TheUnknownDiscord

parry

Feb 7th, 2022 (edited)
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. owner.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
  2. NLS([[
  3. owner.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
  4. ]],owner.PlayerGui)
  5. local canbreak = {}
  6. owner.Character.Humanoid.BreakJointsOnDeath = false
  7. owner.Character.Humanoid.HealthChanged:Connect(function(newHealth)
  8. pcall(function()
  9. if owner.Character.Humanoid.MaxHealth > newHealth then
  10. owner.Character.Humanoid.Health = owner.Character.Humanoid.MaxHealth
  11. end
  12. end)
  13. end)
  14. owner.Character.Humanoid.RequiresNeck = false
  15. bodyparts2 = {}
  16. bodyparts = {}
  17. function protectlimb(part,props,index)
  18. if not part then return end
  19. coroutine.wrap(function()
  20. local index,props = index or #bodyparts+1,props or {Parent = part.Parent}
  21. bodyparts[index] = part
  22. part.Parent = props.Parent
  23. part.AncestryChanged:Connect(function(part,newparent)
  24. pcall(function()
  25. coroutine.wrap(function()
  26. if newparent ~= nil and newparent ~= props.Parent then
  27. part.Parent = props.Parent
  28. else
  29. coroutine.wrap(function()
  30. owner.Character.HumanoidRootPart.Anchored = true
  31. wait(0.125)
  32. owner.Character.HumanoidRootPart.Anchored = false
  33. end)()
  34. local newm = part:Clone()
  35. newm.Name = part.Name
  36. newm.Parent = part.Parent
  37. newm.Part0 = part.Part0
  38. newm.Part1 = part.Part1
  39. protectlimb(newm,props,index)
  40. end
  41. end)()
  42. end)
  43. end)
  44. end)()
  45. end
  46. function protectlimb2(part2,props2,index2)
  47. if not part2 then return end
  48. coroutine.wrap(function()
  49. local index2,props2 = index2 or #bodyparts2+1,props2 or {Parent = part2.Parent}
  50. bodyparts2[index2] = part2
  51. part2.Parent = props2.Parent
  52. part2.AncestryChanged:Connect(function(part2,newparent)
  53. pcall(function()
  54. coroutine.wrap(function()
  55. if newparent ~= nil and newparent ~= props2.Parent then
  56. part2.Parent = props2.Parent
  57. else
  58. coroutine.wrap(function()
  59. owner.Character.HumanoidRootPart.Anchored = true
  60. wait(0.125)
  61. owner.Character.HumanoidRootPart.Anchored = false
  62. end)()
  63. local newm = part2:Clone()
  64. newm.Name = part2.Name
  65. newm.Parent = part2.Parent
  66. newm.Part0 = part2.Part0
  67. newm.Part1 = part2.Part1
  68. protectlimb2(newm,props2,index2)
  69. end
  70. end)()
  71. end)
  72. end)
  73. end)()
  74. end
  75. for i,v in pairs(owner.Character:GetDescendants()) do
  76. coroutine.wrap(function()
  77. if v:IsA("Motor") then
  78. protectlimb(v)
  79. elseif v:IsA("Weld") and not table.find(canbreak,v) then
  80. protectlimb2(v)
  81. end
  82. end)()
  83. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement