Damage Ragdolled Body

Is there a function to allow you to damage / kill a ragdolled player.

Say for example I ragdoll my friend thats at 30hp, is there a way i can shoot him when he’s ragdolled and kill him, or at least a way to make it so he drops to the ground like a corpse and can be killed.



I’m not quite sure what you mean though, if he’s a ragdoll how can he die again?

I think he might be referring to that taser swep that ragdolls you for a short time or he might be talking about some sort of “knock out” code he is making that ragdolls you but does not kill you.

If the ragdoll entity is scripted and stores what player owns it, you can relay all damage on it to the player it belongs to. The ragdoll isn’t actually the player, it’s just a ragdoll of the same model. Depending on what addon you’re using and how it is doing the ragdolling, it might store the owner in a different way. You can look into Entity:GetRagdollOwner(), but you’ll probably wanna look at the code that does the ragdolling in the first place.

To relay the damage, simply catch any damage on the ragdoll with either a EntityTakeDamage hook or in the entity’s ENT:OnTakeDamage, then use Entity:TakeDamageInfo on the ragdoll owner with the same damage info as the hooks/functions gave.