when a humanoid dies, it stays there unless its the humanoid of a character of a player. how can i make it so when a player's character dies, the dead character stays there and nothing else is affected, meaning the player would still respawn with a new character.
i looked in a lot of places, all i see is make it so the character doesnt load and it must be done manually but that isnt what i want, i still want respawning i just want the dead character to stay there forever. i tried cloning but it wont work. pls help
Not one to spoon feed. Please show us your current code to see what you have tried to do already. But anyways here you go put this as a normal Script in StarterPlayer.StarterCharacterScripts
local debrisservice = game:GetService('Debris') local body = script.Parent local player = game.Players:GetPlayerFromCharacter(script.Parent) local humanoid = body:WaitForChild('Humanoid') local bodydisposal = 30 -- Time till body is removed set to a high number if you dont want it to despawn humanoid.Died:Connect(function() if player ~= nil and humanoid ~= nil then body.Archivable = true script.Parent = game:GetService("ServerScriptService") local cloneChar = body:Clone() cloneChar.Name = player.Name.."'s Deadbody" if game:GetService("Workspace"):FindFirstChild(cloneChar.Name) then game:GetService("Workspace"):FindFirstChild(cloneChar.Name):Destroy() end wait(0.1) cloneChar.Parent = game:GetService("Workspace") local rootPart = cloneChar.HumanoidRootPart or cloneChar.Torso local clonedHumanoid = cloneChar:FindFirstChildOfClass("Humanoid") cloneChar:MoveTo(rootPart.Position) rootPart.Orientation = Vector3.new(90,0,0) clonedHumanoid.PlatformStand = true clonedHumanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None clonedHumanoid.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff for i, v in pairs(cloneChar:GetChildren()) do if v:IsA("BasePart") then v.Anchored = false v.CanCollide = false end if v:IsA("Script") or v:IsA("LocalScript") then v:Destroy() end end if cloneChar:FindFirstChild("ForceField") then cloneChar.ForceField:Destroy() end body.Parent = game:GetService("ServerStorage") debrisservice:AddItem(cloneChar,bodydisposal) debrisservice:AddItem(script,bodydisposal) wait(1) if rootPart.Orientation ~= Vector3.new(90,0,0) then rootPart.Orientation = Vector3.new(90,0,0) end end end)