duplicator.DoGenericPhysics

From GMod Wiki

Revision as of 07:19, 23 March 2010 by Zero5100 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Warning 64.pngThis page needs to be edited as it contains information that is unclear or incorrect. Improvement can be discussed on the talk page. Find more pages that need work here.
Details: None given.
Function
Syntax duplicator.DoGenericPhysics( Entity Entity, Player Player, Table Data )
Where is this used?
Description:
Applies bone data, generically.
Returns: nil
Part of Library: duplicator
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Duplicator.DoGenericPhysics]Duplicator.DoGenericPhysics [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSets bones in place.
Used onNewerServer.png
Code
 
if (!data) then return end 
if (!data.PhysicsObjects) then return end 
 
for Bone, Args in pairs( data.PhysicsObjects ) do 
 
	local Phys = Entity:GetPhysicsObjectNum(Bone) 
 
	if ( Phys && Phys:IsValid() ) then	 
 
		Phys:SetPos( Args.Pos ) 
		Phys:SetAngle( Args.Angle ) 
 
		if ( Args.Frozen == true ) then  
			Phys:EnableMotion( false )  
			Player:AddFrozenPhysicsObject( Entity, Phys ) 
		end 
 
	end 
 
end 
 
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox