constraint.Hydraulic

From GMod Wiki

Revision as of 05:40, 2 March 2010 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax constraint.Hydraulic( Player pl, Entity Ent1, Entity Ent2, Number Bone1, Number Bone2, Vector LPos1, Vector LPos2, Number Length1, Number Length2, Number width, Number key, Number fixed, Number speed )
Where is this used?
Description:
Creates a hydraulic constraint.
Returns: Entity constraint, Entity rope, Entity controller, Entity slider
Part of Library: Constraint
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Constraint.Hydraulic]Constraint.Hydraulic [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionTaken from the Hydralic tool in toolgun.
Used onNewerServer.png
Code
// Get client's CVars
local width			= self:GetClientNumber( "width", 3 )
local bind			= self:GetClientNumber( "group", 1 )
local AddLength		= self:GetClientNumber( "addlength", 0 )
local fixed			= self:GetClientNumber( "fixed", 1 )
local speed			= self:GetClientNumber( "speed", 64 )
 
// Get information we're about to use
local Ent1,  Ent2  = self:GetEnt(1),	 self:GetEnt(2)
local Bone1, Bone2 = self:GetBone(1),	 self:GetBone(2)
local LPos1, LPos2 = self:GetLocalPos(1),self:GetLocalPos(2)
local WPos1, WPos2 = self:GetPos(1),     self:GetPos(2)
 
local Length1 = (WPos1 - WPos2):Length()
local Length2 = Length1 + AddLength	
 
local constraint,rope,controller,slider = constraint.Hydraulic( self:GetOwner(), Ent1, Ent2, Bone1, Bone2, LPos1, LPos2, Length1, Length2, width, bind, fixed, speed )
OutputN/A


Additional Notes

See Also

Stub.pngThis article is a stub.
You can help the GMod Wiki by expanding it.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox