How would I get the position of the player's character when they die?

I want to get the location of where a player was when they died. Whenever they die, all of their body parts are destroyed so it’s hard to find where they last were. Is there anyway to circumvent this without having to use a loop that constantly checks their position?

1 Like

I am pretty sure that “CharacterRemoving” is an event that fires right before a character is removed. Using this you can get the HumanoidRootPart

1 Like

After testing the “CharacterRemoving” event, it seems that it only fires right before the player respawns (after the body parts are destroyed), not when they die.

1 Like

Tested this, and it worked: (Proof of concept, use things like “wait for child” and “get service”)

game.Players.PlayerAdded:Connect(function(client)
	client.CharacterAdded:Connect(function(character)
		character.Humanoid.Died:Connect(function()
			print(character.HumanoidRootPart.Position);
		end);
	end);
end);

Also, sorry. I thought that CharacterRemoving is a function that fires with the parts still there.

1 Like

Weird. When I pasted that exact script into my game, it gives the error “HumanoidRootPart is not a valid member of Model Workspace.XdJackyboiiXd21.” Maybe my game is more laggy than yours?

Edit: I just figured out the problem. I was testing it by falling into the void, so it wasn’t the player dieing that caused the body parts to break, but instead the void destroying them.

1 Like

Oh, that actually makes a lot of sense. Glad it worked!

1 Like