Revert color of part attached to player back to before player died

I have a part connected to the player, when the player diess the part is meant to revert back to the color it was before it died, when i to print the color it works and prints the color they where before they died but when i try to revert the color back it dosent work .

Here is the script:

	local character = player.Character
	if character then
		local linePart = character:WaitForChild("LinePart", 4)

		local brickColor = linePart.BrickColor
		linePart.BrickColor = brickColor


this script doesn’t help. show us the script to save the colour