I have this ragdoll script
function Start(children)
for i=1, #children do
local child = children[i]
if child.ClassName == 'Motor6D' then
child.Enabled = false
end
end
end
function Stop(children)
for i=1, #children do
local child = children[i]
if child.ClassName == 'Motor6D' then
child.Enabled = true
end
end
end
game.Players.PlayerAdded:Connect(function(added)
wait(6)
local hit = workspace:FindFirstChild(added.Name).Head
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
for index, joint in pairs(hit.Parent: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
print('Ragdoll Added')
end
wait(1)
Start(workspace:FindFirstChild(added.Name).Torso:GetChildren())
end
end
end)
Put into ServerScriptService
With a custom character
that has this script:
workspace.ChildAdded:Connect(function(added)
if game.Players:FindFirstChild(added.Name) then
local id = game.Players:FindFirstChild(added.Name).UserId
local dummy = game.ReplicatedStorage.Dummy:Clone()
dummy.Parent = game.ServerStorage
local newHumanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(id)
dummy.Humanoid:ApplyDescription(newHumanoidDescription)
local get = dummy:GetDescendants()
for i=1, #get do
local child = get[i]
if child.ClassName == 'Accessory' then
child.Parent = added
end
if child.ClassName == 'BodyColors' then
added:FindFirstChildWhichIsA('BodyColors'):Destroy()
local clon = child:Clone()
clon.Parent = added
clon.TorsoColor = BrickColor.new('Dark green')
clon.RightLegColor = BrickColor.new('Dark stone grey')
clon.LeftLegColor = BrickColor.new('Dark stone grey')
end
end
dummy:Destroy()
end
end)
also in the same location
and the ragdoll script does not work… anyone know how to fix it?