Garry's Mod Wiki

Revision Difference

construct.Magnet#524790

<function name="Magnet" parent="construct" type="libraryfunc"> <description>Creates a magnet.</description> <realm>Server</realm> <file line="94">lua/includes/modules/construct.lua</file> <args> <arg name="ply" type="Player">Player that will have the numpad control over the magnet</arg> <arg name="pos" type="Vector">The position of the magnet</arg> <arg name="ang" type="Angle">The angles of the magnet</arg> <arg name="model" type="string">The model of the maget</arg> <arg name="material" type="string">Material of the magnet ( texture )</arg> <arg name="key" type="number">The key to toggle the magnet, see <page>Enums/KEY</page></arg> <arg name="maxObjects" type="number">Maximum amount of objects the magnet can hold</arg> <arg name="strength" type="number">Strength of the magnet</arg> <arg name="nopull" type="number" default="0">If &amp;gt; 0, disallows the magnet to pull objects towards it</arg> <arg name="allowrot" type="number" default="0">If &amp;gt; 0, allows rotation of the objects attached</arg> <arg name="startOn" type="number" default="0">If &amp;gt; 0, enabled from spawn</arg> <arg name="nopull" type="number" default="0">If > 0, disallows the magnet to pull objects towards it</arg> <arg name="allowrot" type="number" default="0">If > 0, allows rotation of the objects attached</arg> <arg name="startOn" type="number" default="0">If > 0, enabled from spawn</arg> <arg name="toggle" type="number">If != 0, pressing the key toggles the magnet, otherwise you'll have to hold the key to keep it enabled</arg> <arg name="vel" type="Vector" default="Vector( 0, 0, 0 )">Velocity to set on spawn</arg> <arg name="aVel" type="Angle" default="Angle( 0, 0, 0 )">Angular velocity to set on spawn</arg> <arg name="frozen" type="boolean" default="false">Freeze the magnet on start</arg> </args> <rets> <ret name="" type="Entity">The magnet</ret> </rets> </function>