csgo_weapons
The csgo_weapons table queries CS:GOβs internal weapon system data.
Lookup Syntax
Section titled βLookup SyntaxβYou can look up weapon data via three different methods:
-- By item definition index (e.g. 7 = AK-47)local ak47_data = csgo_weapons[7]
-- By weapon console namelocal m4_data = csgo_weapons.weapon_m4a1
-- By weapon entity indexlocal weapon_ent = entity.get_local_player():get_active_weapon()local active_data = csgo_weapons(weapon_ent:ent_index())All forms return a weapon_data_t object, or nil if not found.
weapon_data_t Fields
Section titled βweapon_data_t Fieldsβ| Field | Type | Description |
|---|---|---|
definition_index |
number |
Item definition index (used to load weapon icon). |
console_name |
string |
Console identifier (e.g. "weapon_ak47"). |
name |
string |
Localized weapon name (e.g. "AK-47"). |
hud_name |
string |
Localization token (e.g. "#SFUI_WPNHUD_AK47"). |
type |
string |
"rifle", "pistol", "sniper_rifle", "smg", "shotgun", "knife", "grenade". |
damage |
number |
Base bullet damage. |
armor_ratio |
number |
Armor penetration ratio. |
penetration |
number |
Autowall penetration power value. |
range |
number |
Max effective range in units. |
range_modifier |
number |
Range falloff modifier multiplier. |
headshot_multiplier |
number |
Headshot damage multiplier. |
max_clip1 / max_clip2 |
number |
Primary and secondary clip capacities. |
default_clip1 / default_clip2 |
number |
Default ammo count upon spawn. |
primary_reserve_ammo |
number |
Reserve ammunition capacity. |
cycle_time / cycle_time_alt |
number |
Seconds between consecutive shots. |
full_auto |
boolean |
true if weapon fires continuously while holding attack. |
bullets |
number |
Bullets per shot (e.g. 1 for rifles, 8 for shotguns). |
recoil_seed / spread_seed |
number |
Spread RNG seeds. |
max_speed / max_speed_alt |
number |
Movement speed in units/s (unscoped / scoped). |
price |
number |
Buy menu purchase price. |
kill_award |
number |
Cash bonus per kill. |
slot / position |
number |
Inventory slot category and sub-position. |
world_model |
string |
Model path for dropped weapon. |
view_model |
string |
Model path for first-person view. |
is_melee |
boolean |
true for knives/fists. |
has_silencer |
boolean |
true for weapons with detachable suppressors. |
