Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ragdollold(model, ragdolltime)
- local ragged = Instance.new("NumberValue",model)
- ragged.Name = "ragged"
- game.Debris:AddItem(ragged, ragdolltime)
- local torso = model:FindFirstChild("Torso") or model:FindFirstChild("UpperTorso")
- for i,v in pairs (model:GetDescendants()) do
- if v:IsA("Motor") or v:IsA("Motor6D") then
- if v.Name == "Right Shoulder" then
- old = v.Parent
- local glue = Instance.new("Glue",old)
- glue.Part0 = v.Part0
- glue.Part1 = v.Part1
- glue.C0 = v.C0
- glue.C1 = v.C1
- v.Parent = nil
- game.Debris:AddItem(glue, ragdolltime)
- if model:FindFirstChild("Right Arm") then
- local ack = model["Right Arm"]
- local hitbox = ack:Clone()
- hitbox.Parent = ack
- hitbox.Size = ack.Size
- hitbox.Transparency = 1
- hitbox.CanCollide = true
- hitbox.Anchored = false
- ezweld(hitbox, hitbox, ack, CFrame.new())
- game.Debris:AddItem(hitbox, ragdolltime)
- end
- coroutine.resume(coroutine.create(function()
- wait(ragdolltime)
- v.Parent = old
- end))
- end
- if v.Name == "Left Shoulder" then
- old = v.Parent
- local glue = Instance.new("Glue",old)
- glue.Part0 = v.Part0
- glue.Part1 = v.Part1
- glue.C0 = v.C0
- glue.C1 = v.C1
- v.Parent = nil
- game.Debris:AddItem(glue, ragdolltime)
- if model:FindFirstChild("Left Arm") then
- local ack = model["Left Arm"]
- local hitbox = ack:Clone()
- hitbox.Parent = ack
- hitbox.Size = ack.Size
- hitbox.Transparency = 1
- hitbox.CanCollide = true
- hitbox.Anchored = false
- ezweld(hitbox, hitbox, ack, CFrame.new())
- game.Debris:AddItem(hitbox, ragdolltime)
- end
- coroutine.resume(coroutine.create(function()
- wait(ragdolltime)
- v.Parent = old
- end))
- end
- if v.Name == "Right Hip" then
- old = v.Parent
- local glue = Instance.new("Glue",old)
- glue.Part0 = v.Part0
- glue.Part1 = v.Part1
- glue.C0 = v.C0
- glue.C1 = v.C1
- v.Parent = nil
- game.Debris:AddItem(glue, ragdolltime)
- if model:FindFirstChild("Right Leg") then
- local ack = model["Right Leg"]
- local hitbox = ack:Clone()
- hitbox.Parent = ack
- hitbox.Size = ack.Size
- hitbox.Transparency = 1
- hitbox.CanCollide = true
- hitbox.Anchored = false
- ezweld(hitbox, hitbox, ack, CFrame.new())
- game.Debris:AddItem(hitbox, ragdolltime)
- end
- coroutine.resume(coroutine.create(function()
- wait(ragdolltime)
- v.Parent = old
- end))
- end
- if v.Name == "Left Hip" then
- old = v.Parent
- local glue = Instance.new("Glue",old)
- glue.Part0 = v.Part0
- glue.Part1 = v.Part1
- glue.C0 = v.C0
- glue.C1 = v.C1
- v.Parent = nil
- game.Debris:AddItem(glue, ragdolltime)
- if model:FindFirstChild("Left Leg") then
- local ack = model["Left Leg"]
- local hitbox = ack:Clone()
- hitbox.Parent = ack
- hitbox.Size = ack.Size
- hitbox.Transparency = 1
- hitbox.CanCollide = true
- hitbox.Anchored = false
- ezweld(hitbox, hitbox, ack, CFrame.new())
- game.Debris:AddItem(hitbox, ragdolltime)
- end
- coroutine.resume(coroutine.create(function()
- wait(ragdolltime)
- v.Parent = old
- end))
- end
- end
- if v:IsA("Humanoid") then
- v.PlatformStand = true
- coroutine.resume(coroutine.create(function()
- wait(ragdolltime)
- v.PlatformStand = false
- end))
- end
- if v:IsA("Part") and v.Name == "Torso" then
- local a = 60
- v.Velocity = Vector3.new(math.random(-a, a), math.random(-a, a), math.random(-a, a))
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement