PlayerDeath - Help

How would it be possible to get the owner of the prop that is used to kill a player?
I mean, on PlayerDeath hook if the killer (or weapon) is a prop_physics (a prop) get the owner of the prop?
function playerDies( victim, weapon, killer )


hook.Add( “PlayerDeath”, “playerDeathTest”, playerDies )

Untested, and I’m sure there are infinitely better ways to do this.

local function OnPropSpawned( pl, _, ent )
	ent:SetNWEntity( "Owner", pl );
hook.Add( "PlayerSpawnedProp", "OnPropSpawned", OnPropSpawned );

local function PlayerDies( victim, inflictor, killer )
	local ent = inflictor:GetClass() == "prop_physics" && inflictor:GetNWEntity( "Owner" );
	if( IsValid( ent ) && IsValid( inflictor ) && ent:IsPlayer() && ent != victim ) then
		//Do stuff here.
		//Msg( Format( "
%s was killed by %s using %s
", victim:Name(), ent:Name(), inflictor:GetClass() ) );
hook.Add( "PlayerDeath", "PlayerDies", PlayerDies );