Hello, after getting alot of support from NeutralEnergy, ive decided to make a repost to finish up what he has helped me with. The script itself works, just the client is buggy, for an example whenever a player touches the ragdoll, it stands up and starts spinning slowly…
i also want to make it into R6.
could anyone help? thanks!
the script goes into serverscriptservice
local players = game:GetService("Players")
local function makeRagDoll(doll)
for index, joint in pairs (doll: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
end
local function makeDup(char)
char.Archivable = true
local dChar = char:Clone()
char.Archivable = true
dChar.Parent = workspace
for i, v in pairs(char:GetDescendants()) do
if v:IsA("BasePart") then
v.CanCollide = false
v.Anchored = true
v.Transparency = 1
end
end
local healthScript = dChar:FindFirstChild("Health")
if healthScript then
healthScript.Enabled = false
end
if dChar then
makeRagDoll(dChar)
else
warn("No Character Duplicate!")
end
end
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
hum.Died:Connect(function()
print("Player Has Died!", player.Name)
makeDup(char)
end)
end)
end)