You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
a ragdoll after the player dies and gets cloned -
What is the issue? Include screenshots / videos if possible!
none, i just simply dont know how -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
no
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
So ive been working on a script where if the player dies he gets cloned, but i want to add a ragdoll too, could anyone tell me how to do it or even better give me a finished script? Thanks for reading!
local players = game:GetService("Players")
local function makeDup(char)
char.Archivable = true
local dChar = char:Clone()
char.Archivable = false
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
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)