local function RagdollPlayer(hit)
local character = hit.Parent
local player = Players:GetPlayerFromCharacter(character)
if character:FindFirstChild("Humanoid") then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local thrower = hitbox:GetAttribute("Thrower")
humanoidRootPart.Anchored = false
if thrower ~= character.Name then
for _, limb in pairs(character:GetChildren()) do
if limb:IsA("BasePart") then
if limb.Name ~= "Head" and not string.match(limb.Name, "Foot") and not string.match(limb.Name, "Hand") then
for _, constraint in pairs(limb:GetChildren()) do
if constraint:IsA("Motor6D") then
local attachment0 = Instance.new("Attachment")
attachment0.CFrame = constraint.C0
attachment0.Parent = constraint.Part0
local attachment1 = Instance.new("Attachment")
attachment1.CFrame = constraint.C1
attachment1.Parent = constraint.Part1
local ballSocketConstraint = Instance.new("BallSocketConstraint")
ballSocketConstraint.Attachment0 = attachment0
ballSocketConstraint.Attachment1 = attachment1
ballSocketConstraint.LimitsEnabled = true
ballSocketConstraint.TwistLimitsEnabled = true
ballSocketConstraint.Parent = limb
constraint:Destroy()
end
end
else
local weldConstraint = Instance.new("WeldConstraint")
weldConstraint.Part0 = character:FindFirstChild("Head")
weldConstraint.Part1 = character:FindFirstChild("UpperTorso")
weldConstraint.Parent = character:FindFirstChild("Head")
end
end
end
end
end
end
TOUCHED:Connect(RagdollPlayer)
However it’s a bit glitchy and the player seems to be “floating”, any ideas on why this is happening and how it can be fixed?
This can be fixed by setting the humanoid state to ragdoll and disabling getup state However this is what i use for players i don’t know if this would work on Dummies i never tried it also player humanoid states can only be changed in a local script
Edit: i looked it up and you can change dummies Humanoid State Since they don’t have a Network ownership this can only be used in server scripts
local Players = game:GetService(“Players”)
local RunService = game:GetService(“RunService”)
local hitbox = script.Parent
local TOUCHED = hitbox.Touched
local function RagdollPlayer(hit)
local character = hit.Parent
local player = Players:GetPlayerFromCharacter(character)
if character:FindFirstChild("Humanoid") then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local humanoid = character:FindFirstChild("Humanoid")
local thrower = hitbox:GetAttribute("Thrower")
humanoidRootPart.Anchored = false
if thrower ~= character.Name then
for _, limb in pairs(character:GetChildren()) do
if limb:IsA("BasePart") then
if limb.Name ~= "Head" and not string.match(limb.Name, "Foot") and not string.match(limb.Name, "Hand") then
for _, constraint in pairs(limb:GetChildren()) do
if constraint:IsA("Motor6D") then
local attachment0 = Instance.new("Attachment")
attachment0.CFrame = constraint.C0
attachment0.Parent = constraint.Part0
local attachment1 = Instance.new("Attachment")
attachment1.CFrame = constraint.C1
attachment1.Parent = constraint.Part1
local ballSocketConstraint = Instance.new("BallSocketConstraint")
ballSocketConstraint.Attachment0 = attachment0
ballSocketConstraint.Attachment1 = attachment1
ballSocketConstraint.LimitsEnabled = true
ballSocketConstraint.TwistLimitsEnabled = true
ballSocketConstraint.Parent = limb
local function ChangeHumanoidState()
humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
end
ChangeHumanoidState()
constraint:Destroy()
end
end
else
local weldConstraint = Instance.new("WeldConstraint")
weldConstraint.Part0 = character:FindFirstChild("Head")
weldConstraint.Part1 = character:FindFirstChild("UpperTorso")
weldConstraint.Parent = character:FindFirstChild("Head")
end
end
end
end
end
end
TOUCHED:Connect(RagdollPlayer)
It kinda works for a little bit, but then after a few seconds it goes back to the floating thing.
From the Wiki, this seems to say, that, Ragdoll may be turned-off, but if getting up is Disabled, who knows what State will be turned on…? It sure looks like it is trying to get-up…
If you set the State to Physics at some point I’m pretty sure it WILL stay in THAT state.
The Humanoid will enter the GettingUp state 1 second after the Ragdoll state is enabled. When this happens this event will fire with an active value of false , and Humanoid.GettingUp will fire with an active value of true .
There is also a script here which Prints-out it’s state:
You can try setingt it’s Humanoid’s Parent to nil; then re-Parent it to the Model… (I know in a Local Script you can de-parent a Server Model, then re-parent it) Try everything…