constraint.Pulley

From GMod Wiki

Revision as of 17:02, 3 April 2010 by Donkie (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax constraint.Pulley( Entity Ent1, Entity Ent4, Number Bone1, Number Bone4, Vector LPos1, Vector LPos4, Vector WPos2, Vector WPos3, Number forcelimit, Number rigid, Number width, String material )
Where is this used?
Description:
Creates a pulley constraint.
Returns: Entity constraint
Part of Library: constraint
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Constraint.Pulley]Constraint.Pulley [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSave this in a file in autorun/server and run gm_flatgrass and you should see 2 balls with a pulley inbetween.
Used onNewerServer.png
Code
function somerandompulleytest()
	local ent1 = ents.Create("prop_physics")
		ent1:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
		ent1:SetPos(Vector(0,0,20))
		ent1:Spawn()
		ent1:Activate()
 
	local ent2 = ents.Create("prop_physics")
		ent2:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
		ent2:SetPos(Vector(30,0,50))
		ent2:Spawn()
		ent2:Activate()
 
 
	constraint.Pulley(ent1,ent2,0,0,Vector(0,0,5),Vector(0,0,5),Vector(0,0,100),Vector(30,0,100),0,0,5,"cable/cable")
end
hook.Add( "InitPostEntity", "somerandompulleytest", somerandompulleytest )
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox