constraint.FindConstraint

From GMod Wiki

Revision as of 05:07, 30 October 2009 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax constraint.FindConstraint( Entity , String name )
Where is this used?
Description:
Returns the table with information about the first constraint on an entity with the specific name.
Returns: Table
Part of Library: constraint
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Constraint.FindConstraint]Constraint.FindConstraint [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionFinds the first hydraulic on the targeted entity.
Used onNewerServer.png
Code
local constr = constraint.FindConstraint( trace.Entity, "Hydraulic" )
-- constr.Constraint is the actual constraint.
-- constr.Entity is a table of each Entity connected to the constraint.
--     it includes these items.
--     constr.Entity[1].Index       number
--     constr.Entity[1].Entity      entity
--     constr.Entity[1].Bone        number
--     constr.Entity[1].LPos        vector
--     constr.Entity[1].WPos        vector
--     constr.Entity[1].Length      number
--     constr.Entity[1].World       boolean
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox