-
What do you want to achieve? Keep it simple and clear!
I’m trying to just make a dead good ragdoll. This ragdoll gets cloned once when the player respawns so it stays and doesn’t disappear -
What is the issue? Include screenshots / videos if possible!
The cloned version of the player’s ragdoll stands back up even though its health is 0 and its states have been changed.
Works fine below
But a few seconds later…
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried like every solution from the Developer Hub and what I could think.
-Changing states to dead, physics, ragdoll
-Disabling the GetUp state
-PlatformStand (this works but it sets their part collisions to false which I don’t like),
-Anchoring (I want to be able to move them still)
-Setting health from 0 to 100 and then back to 0 (SOMETIMES works)
local folder = Instance.new("Folder")
folder.Name = "Ragdolls"
folder.Parent = workspace
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
char.Humanoid.BreakJointsOnDeath = false
char.Humanoid.Died:Connect(function()
char.Archivable = true
for i,v in pairs(player.Backpack:GetChildren()) do v:Destroy() end
for i,v in pairs(char:GetChildren()) do if v:IsA("Tool") then v:Destroy() end end
for index,joint in pairs(char:GetDescendants()) do
if joint:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local a1 = Instance.new("Attachment")
local a2 = Instance.new("Attachment")
a1.Parent = joint.Part0
a2.Parent = joint.Part1
socket.Parent = joint.Parent
socket.Attachment0 = a1
socket.Attachment1 = a2
a1.CFrame = joint.C0
a2.CFrame = joint.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
joint:Destroy()
end
end
player.CharacterAdded:Wait()
local ClonedChar = char:Clone()
for i,v in pairs(ClonedChar:GetDescendants()) do
if v:IsA("ForceField") then v:Destroy() end
end
ClonedChar.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
ClonedChar.Humanoid.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
ClonedChar.Health:Destroy()
ClonedChar.Name = player.Name.."'s Ragdoll"
ClonedChar.Parent = folder
end)
end)
end)