So I'm trying to make it so that when the player dies, they respawn:
local function CharacterLoop(Player) Player:LoadCharacter() local Character = Player.Character local NewCharacter = game:GetService("ServerStorage"):WaitForChild("Clak"):Clone() NewCharacter.Parent = game.Workspace NewCharacter.Name = Player.Name Player.Character = NewCharacter local CameraFixer = script.CameraFixer:Clone() CameraFixer.Disabled = false CameraFixer.Parent = Player:WaitForChild("PlayerGui") local Humanoid = Character:WaitForChild("Humanoid") NewCharacter:WaitForChild("Animate").Disabled = false Humanoid.Died:connect(function(deadPlayer) wait(2) CharacterLoop(Player) end) end
However, the Died event does not fire at all. The Clak contains a HumanoidRootPart, a Head, and a Torso, and all of its parts are welded.
EDIT: If it helps, the model does not break apart upon death.
You formed the function the wrong way, I am doing this on my phone so u may need to debug it a little bit, looks good so far thought.
local Player = game.Players.LocalPlayer Player.CharacterAdded:connect(function(Character) Character:WaitForChild("Humanoid").Died:connect(function() local NewCharacter = game:GetService("ServerStorage"):WaitForChild("Clak"):Clone() NewCharacter.Parent = game.Workspace NewCharacter.Name = Player.Name Player.Character = NewCharacter local CameraFixer = script.CameraFixer:Clone() CameraFixer.Disabled = false CameraFixer.Parent = Player:WaitForChild(“PlayerGui”) NewCharacter:WaitForChild("Animate").Disabled = false end) end)
Also may need to make spacing look nicer
I figured it out, the humanoid was the humanoid of the previous character. Using newcharacter's humanoid fixed it.