Entity/GetRagdollOwner

From Garry's Mod
Jump to: navigation, search
 Entity:GetRagdollOwner( )

Contents

Description

Returns the entity which the ragdoll came from. The opposite of Player:GetRagdollEntity.

Returns

Entity

The entity who owns the ragdoll.

Examples

Example

Loop through all player ragdolls and print their owners.

for e, ent in pairs( ents.GetAll() ) do
	if( IsValid( ent:GetRagdollOwner() ) ) then
		print( ent:GetRagdollOwner() )
	end
end

Output:

While a player is dead and their ragdoll is spawned this returns:
Player [1][PlayerName]
Personal tools
Navigation