I’m looking to fix my ragdoll script for my JoJo game, but anytime it’s activated it starts flying away. I have no experience with making ragdolls so I’m very confused.
With Body Velocity Force:
External MediaWithout Body Velocity Force:
External MediaThe ragdoll is enabled or disabled when a script changes the bool value.
after 6 seconds the ragdoll is disabled, that’s why it just goes back to normal.
My Script:
local folder = Instance.new("Folder")
folder.Parent = script.Parent
folder.Name = "RagdollFolder"
script.Parent.Humanoid.Died:Connect(function()
script.Parent.Ragdolled.Value = true
end)
script.Parent.Ragdolled.Changed:Connect(function(val)
if val == true then
for i,v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Motor6D") and v.Parent.Parent.Name ~= "Stand" then
local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
local BodyFolder = Instance.new("Folder")
BodyFolder.Parent = script.Parent:FindFirstChild("RagdollFolder")
BodyFolder.Name = v.Parent.Name.."RagdollFolder"
a0.CFrame = v.C0
a1.CFrame = v.C1
a0.Parent = v.Part0
a1.Parent = v.Part1
local b = Instance.new("BallSocketConstraint")
b.Attachment0 = a0
b.Attachment1 = a1
b.Parent = BodyFolder
v.Enabled = false
end
end
elseif val == false then
for i,v in pairs(script.Parent:FindFirstChild("RagdollFolder"):GetChildren()) do
if v:IsA("Folder") and v:FindFirstChildOfClass("BallSocketConstraint") then
v:FindFirstChildOfClass("BallSocketConstraint").Attachment0:Destroy()
v:FindFirstChildOfClass("BallSocketConstraint").Attachment1:Destroy()
v:Destroy()
end
end
for i,v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Motor6D") then
v.Enabled = true
end
end
end
end)
If anyone could help me out that would be amazing, thanks!