Garry's Mod Wiki

Revision Difference

constraint.Rope#560547

<function name="Rope" parent="constraint" type="libraryfunc"> <description>Creates a rope constraint - with rope!</description> <realm>Server</realm> <file line="468-L540">lua/includes/modules/constraint.lua</file> <args> <arg name="Ent1" type="Entity">First entity</arg> <arg name="Ent2" type="Entity">Second entity</arg> <arg name="Bone1" type="number">Bone of first entity (0 for non-ragdolls)</arg> <arg name="Bone2" type="number">Bone of second entity (0 for non-ragdolls)</arg> <arg name="LPos1" type="Vector">Position of first end of the rope. Local to Ent1.</arg> <arg name="LPos2" type="Vector">Position of second end of the rope. Local to Ent2.</arg> <arg name="length" type="number">Length of the rope.</arg> <arg name="addlength" type="number">Amount to add to the length of the rope. Works as it does in the Rope tool.</arg> <arg name="forcelimit" type="number">Amount of force until it breaks (0 = unbreakable).</arg> <arg name="addlength" type="number" default="0">Amount to add to the length of the rope. Works as it does in the Rope tool.</arg> <arg name="forcelimit" type="number" default="0">Amount of force until it breaks (0 = unbreakable).</arg> <arg name="width" type="number">Width of the rope.</arg> <arg name="material" type="string">Material of the rope.</arg> <arg name="rigid" type="boolean">Whether the constraint is rigid.</arg> <arg name="color" type="table">The color of the rope. See <page>Global.Color</page>.</arg> <arg name="material" type="string" default="">Material of the rope.</arg> <arg name="rigid" type="boolean" default="false">Whether the constraint is rigid.</arg> <arg name="color" type="table" default="color_white">The color of the rope. See <page>Global.Color</page>.</arg> </args> <rets> <ret name="constraint" type="Entity">The constraint entity. Will be a `keyframe_rope` if you are roping to the same bone on the same entity. Will return `false` if the constraint could not be created.</ret> <ret name="rope" type="Entity">The rope entity. Will return `nil` if `constraint` return value is a `keyframe_rope` or if the constraint could not be created.</ret> </rets> </function>