Ragdoll issue

I’m working on a weapon that will change a players model. When the player dies their ragdoll would break.

[lua]hook.Add( “DoPlayerDeath”, “Plantifier_Ragdoll”, function( ply, att, dmg )
if ply:GetActiveWeapon().ClassName == “weapon_ttt_plantdisg” then
ply:SetModel( ply.PrePlantModel )
local rag = CORPSE.Create(ply, attacker, dmginfo)
ply.server_ragdoll = rag
end
end)[/lua]

This creates a ragdoll before the death, but players cannot ID the bodies properly. They’re able to ID bodies, but unable to search them.