Character doesn’t respawn after death. It even starts regenerating health afterwards. Sometimes it does respawn. Usually it doesn’t though.
(EDIT: I think its the ragdoll script because when I disable it it stops happening. Idk what my ragdoll script is doing thats bad.)
Here is a video:
Here is some code I think could be an issue:
ServerScript Snippet #1
humanoid.Died:Connect(function()
player.hiddenStats.Regen.Value=0
if not died then
died = true
local killer = humanoid:GetAttribute("Killer")
if killer then
local killerPlayer = game.Players:FindFirstChild(killer)
killerPlayer.hiddenStats.Regen.Value+=1
Events.KOd:FireClient(killerPlayer, player.Name, 25)
killerPlayer.leaderstats.KOs.Value+=1
killerPlayer.hiddenStats.Cash.Value+=25
humanoid:SetAttribute("Killer", nil)
end
end
end)
ServerScript Snippet #2 (Ragdoll)
local debris = game:GetService("Debris")
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").BreakJointsOnDeath = false
end)
end)
game:GetService("ReplicatedStorage").Events.Ragdoll.OnServerEvent:Connect(function(player)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")
if humanoid and root then
humanoid.Health = 0
humanoid:ChangeState(Enum.HumanoidStateType.Physics)
humanoid.PlatformStand = true
local force = Instance.new("BodyVelocity")
force.MaxForce = Vector3.new(1,0,1) * 10000
force.Velocity = root.CFrame.LookVector * -50
force.Parent = root
for i, v in pairs(character:GetDescendants()) do
if v:IsA("Motor6D") then
local at0 = Instance.new("Attachment", v.Part0)
local at1 = Instance.new("Attachment", v.Part1)
at0.CFrame = v.C0
at1.CFrame = v.C1
local con = Instance.new("RopeConstraint", v.Part0)
con.Name=v.Name
con.Length = 0.1
con.Attachment0 = at0
con.Attachment1 = at1
v:Destroy()
end
end
debris:AddItem(force, 0.1)
end
end)
Any help is appreciated. Thanks.