Keep character when player dies

So I am trying to make an Transformation Script work so when you click a button it will change you character from the current one to the one selected , but I can’t seem to make it work so when you die it saves the new character

Problem: When player dies the character reverts to original?

Code:

local model,oldModel,newModel,oldCFrame,player,modellname

function respawnPlayer(plr, modelName)
	player = plr
	modellname = modelName
	model = game.ReplicatedStorage.Skins:FindFirstChild(modelName)
	print("Model from server is", model)

	oldModel = plr.Character
	newModel = model:Clone()

	oldCFrame = oldModel:GetPrimaryPartCFrame()

	plr.Character = newModel
	newModel.Parent = workspace
	newModel:SetPrimaryPartCFrame(oldCFrame)
	oldModel:Destroy()

end

game.ReplicatedStorage.Skins.ChangeCharacter.OnServerEvent:Connect(respawnPlayer)

How do I make it so when the player dies and respawns he has the same character that he selected?

You could maybe create a BoolValue in the Player and then change it to true when setting the custom character?

game.Players.PlayerAdded:Connect(function(Player)
	local customCharacter = Instance.new("BoolValue")
	customCharacter.Parent = Player
	
	Player.CharacterAppearanceLoaded:Connect(function()
		if customCharacter == true then
			--
		end
	end)
end)

Something like this could maybe work.