weapons/Get

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Add info about when to use GetStored instead)
(Bad advice - the functions behave differently.)
 
Line 1: Line 1:
 
{{Func
 
{{Func
|Name=Get
+
|Description=Get a ''copy'' of weapon table by name. This function also inherits fields from the weapon's base class, unlike {{LibraryFunction|weapons|GetStored}}.
|Parent=weapons
+
|Description=Get copy of weapon table by name. If all you need to do is access a variable from the weapon table, use {{LibraryFunction|weapons|GetStored}} instead.
+
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=No
 
|IsClass=No

Latest revision as of 12:17, 9 May 2019

 weapons.Get( )

Description

Get a copy of weapon table by name. This function also inherits fields from the weapon's base class, unlike weapons.GetStored.

Arguments

string classname

Class name of weapon to retrieve

Returns

table

The retrieved table or nil
Personal tools
Navigation