Garry's Mod Wiki



  weapons.Register( table swep_table, string classname )


Registers a Scripted Weapon (SWEP) class manually. When the engine spawns an entity, weapons registered with this function will be created if the class names match.

See also scripted_ents.Register for Scripted Entities (SENTs)

Sub-tables provided in the first argument will not carry over their metatable, and will receive a BaseClass key if the table was merged with the base's. Userdata references, which includes Vectors, Angles, Entities, etc. will not be copied.


1 table swep_table
The SWEP table
2 string classname
Classname to assign to that swep

Special Pages



Render Time: 20ms

DB GetPage 3
Generate Html 3
SaveChanges (1) 5
Render Body 0
Render Sidebar 6