Garry's Mod Wiki

construct.Magnet

  Entity construct.Magnet( Player ply, Vector pos, Angle ang, string model, string material, number key, number maxObjects, number strength, number nopull = 0, number allowrot = 0, number startOn = 0, number toggle, Vector vel = Vector( 0, 0, 0 ), Angle aVel = Angle( 0, 0, 0 ), boolean frozen = false )

Description

Creates a magnet.

Arguments

1 Player ply
Player that will have the numpad control over the magnet
2 Vector pos
The position of the magnet
3 Angle ang
The angles of the magnet
4 string model
The model of the maget
5 string material
Material of the magnet ( texture )
6 number key
The key to toggle the magnet, see KEY enum
7 number maxObjects
Maximum amount of objects the magnet can hold
8 number strength
Strength of the magnet
9 number nopull = 0
If > 0, disallows the magnet to pull objects towards it
10 number allowrot = 0
If > 0, allows rotation of the objects attached
11 number startOn = 0
If > 0, enabled from spawn
12 number toggle
If != 0, pressing the key toggles the magnet, otherwise you'll have to hold the key to keep it enabled
13 Vector vel = Vector( 0, 0, 0 )
Velocity to set on spawn
14 Angle aVel = Angle( 0, 0, 0 )
Angular velocity to set on spawn
15 boolean frozen = false
Freeze the magnet on start

Returns

1 Entity
The magnet