Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- owner.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
- NLS([[
- owner.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
- ]],owner.PlayerGui)
- local canbreak = {}
- owner.Character.Humanoid.BreakJointsOnDeath = false
- owner.Character.Humanoid.HealthChanged:Connect(function(newHealth)
- pcall(function()
- if owner.Character.Humanoid.MaxHealth > newHealth then
- owner.Character.Humanoid.Health = owner.Character.Humanoid.MaxHealth
- end
- end)
- end)
- owner.Character.Humanoid.RequiresNeck = false
- bodyparts2 = {}
- bodyparts = {}
- function protectlimb(part,props,index)
- if not part then return end
- coroutine.wrap(function()
- local index,props = index or #bodyparts+1,props or {Parent = part.Parent}
- bodyparts[index] = part
- part.Parent = props.Parent
- part.AncestryChanged:Connect(function(part,newparent)
- pcall(function()
- coroutine.wrap(function()
- if newparent ~= nil and newparent ~= props.Parent then
- part.Parent = props.Parent
- else
- coroutine.wrap(function()
- owner.Character.HumanoidRootPart.Anchored = true
- wait(0.125)
- owner.Character.HumanoidRootPart.Anchored = false
- end)()
- local newm = part:Clone()
- newm.Name = part.Name
- newm.Parent = part.Parent
- newm.Part0 = part.Part0
- newm.Part1 = part.Part1
- protectlimb(newm,props,index)
- end
- end)()
- end)
- end)
- end)()
- end
- function protectlimb2(part2,props2,index2)
- if not part2 then return end
- coroutine.wrap(function()
- local index2,props2 = index2 or #bodyparts2+1,props2 or {Parent = part2.Parent}
- bodyparts2[index2] = part2
- part2.Parent = props2.Parent
- part2.AncestryChanged:Connect(function(part2,newparent)
- pcall(function()
- coroutine.wrap(function()
- if newparent ~= nil and newparent ~= props2.Parent then
- part2.Parent = props2.Parent
- else
- coroutine.wrap(function()
- owner.Character.HumanoidRootPart.Anchored = true
- wait(0.125)
- owner.Character.HumanoidRootPart.Anchored = false
- end)()
- local newm = part2:Clone()
- newm.Name = part2.Name
- newm.Parent = part2.Parent
- newm.Part0 = part2.Part0
- newm.Part1 = part2.Part1
- protectlimb2(newm,props2,index2)
- end
- end)()
- end)
- end)
- end)()
- end
- for i,v in pairs(owner.Character:GetDescendants()) do
- coroutine.wrap(function()
- if v:IsA("Motor") then
- protectlimb(v)
- elseif v:IsA("Weld") and not table.find(canbreak,v) then
- protectlimb2(v)
- end
- end)()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement