Entity.GetPhysicsObjectNum

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetPhysicsObjectNum( Integer obj_num )
Description:
Use this to grab the physics object in a ragdoll
Returns: Physobj
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetPhysicsObjectNum]Entity.GetPhysicsObjectNum [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionWhen run, if the player is dead it will throw their ragdoll up in the air.
Used onNewerShared.png
Code
if !LocalPlayer():Alive() && LocalPlayer():GetRagdollEntity() then
	local ent=LocalPlayer():GetRagdollEntity()
	local head=ent:GetPhysicsObjectNum(10)//10 is the bone number of the head.
	head:ApplyForceCenter(Vector(0,0,6000))
end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox