Revision Difference
constraint.Muscle#560635
<function name="Muscle" parent="constraint" type="libraryfunc">
<description>Creates a muscle constraint.</description>⤶
<description>Creates a muscle constraint.⤶
⤶
Very similar to <page>constraint.Hydraulic</page>, but instead of a toggle between fully expanded and contracted, it will continuously alternate between the 2 states while enabled.</description>⤶
<realm>Server</realm>
<file line="1422-L1496">lua/includes/modules/constraint.lua</file>
<args>
<arg name="pl" type="Player">The player that will be used to call <page>numpad.OnDown</page>.</arg>
<arg name="player" type="Player">The player that will be able to control the constraint. Used to call <page>numpad.OnDown</page>.</arg>
<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"></arg>⤶
<arg name="LPos2" type="Vector"></arg>⤶
<arg name="Length1" type="number"></arg>⤶
<arg name="Length2" type="number"></arg>⤶
<arg name="Bone1" type="number">Physics Object number of first entity to constrain to. (0 for non-ragdolls).</arg>
<arg name="Bone2" type="number">Physics Object number of first second to constrain to. (0 for non-ragdolls). Must be different from `bone1`.</arg>
<arg name="localPos1" type="Vector">Position relative to the the first physics object to constrain to.</arg>⤶
<arg name="localPos2" type="Vector">Position relative to the the second physics object to constrain to.</arg>⤶
<arg name="length1" type="number">Minimum length of the constraint.</arg>⤶
<arg name="length2" type="number">Maximum length of the constraint.</arg>⤶
<arg name="width" type="number">Width of the rope.</arg>
<arg name="key" type="number">The key binding, corresponding to an <page>Enums/KEY</page></arg>⤶
<arg name="fixed" type="number">Whether the constraint is fixed.</arg>
<arg name="period" type="number"></arg>⤶
<arg name="amplitude" type="number"></arg>⤶
<arg name="starton" type="boolean"></arg>⤶
<arg name="material" type="string">Material of the rope.</arg>
<arg name="color" type="table">The color of the rope. See <page>Global.Color</page>.</arg>
<arg name="key" type="number">The key binding, corresponding to an <page>Enums/KEY</page>.</arg>⤶
<arg name="fixed" type="number">Whether the constraint is fixed, i.e. cannot bend. Must be `1` to act as `true`.</arg>
<arg name="period" type="number">How often the "contractions" should happen.</arg>⤶
<arg name="amplitude" type="number">Amplification of the "contractions"?</arg>⤶
<arg name="startOn" type="boolean" default="false">Whether the constraint should start activated. (i.e. spazzing)</arg>⤶
<arg name="material" type="string" default="">Material of the rope. If left unset, will be solid black.</arg>
<arg name="color" type="table" default="color_white">The color of the rope. See <page>Global.Color</page>.</arg>
</args>
<rets>
<ret name="" type="Entity">Constraint. Will return false if the constraint could not be created.</ret>
<ret name="" type="Entity">rope. Will return nil if the constraint could not be created.</ret>
<ret name="" type="Entity">controller. Will return nil if the constraint could not be created.</ret>
<ret name="" type="Entity">slider. Will return nil if the fixed argument is not 1 or if the constraint could not be created.</ret>
<ret name="" type="Entity">The created constraint. (`phys_spring`) Will return `false` if the constraint could not be created.</ret>
<ret name="" type="Entity">The crated rope. (`keyframe_rope`) Will return `nil` if the constraint could not be created.</ret>
<ret name="" type="Entity">The muscle controller. (`gmod_winch_controller`) Will return `nil` if the constraint could not be created.</ret>
<ret name="" type="Entity">The slider if `fixed` was exactly `1`. Will return nil otherwise, or if the constraint could not be created.</ret>
</rets>
</function>