Main Page
Manuals
Lua Docs
Getting Started
Tutorials
About
FAQ
Info
Screenshots
Videos
Return to Main Docs Page
SWEP
Information about Scripted Weapons (SWEPs).
Shared Members
Type
Name
Description
Boolean
AdminOnly
If false, admins can't spawn that weapon (you can set to false for base weapons).
Boolean
AllowFlipping
Same as ViewModelFlip.
String
AnimPrefix
This is for animations. (dont working rn)
Boolean
MeleeWeapon
Does nothing, just from Source Engine combat weapon.
Table
m_acttable
Table for activities (animations).
String
Name
Used for name in SpawnMenu.
String
PrintName
Used for name in Weapon Selection.
Table
Primary
Contains infos about the primary attack.
Table
Secondary
Contains infos about the secondary attack.
Boolean
Spawnable
If false, players can't spawn that weapon (you can set to false for base weapons).
String
ViewModel
Path to the view model (the weapon viewed from the player's point of view)
Boolean
ViewModelFlip
Should the view model be flipped? (left handed weapon).
Number
ViewModelFOV
An angle of FOV used for the view model.
String
WorldModel
Path to the world model (the weapon viewed on the ground or in hands of NPCs).
Primary/Secondary Members
Type
Name
Description
String
Ammo
Ammo type for the primary/secondary fire mode ("Pistol", "SMG" etc)
Boolean
Automatic
Should the weapon keep firing if the player's mouse is still down?
Integer
ClipSize
The size of a clip (how much you can shoot before you reload)
Integer
DefaultClip
The default amount of ammo to give when you get the weapon
Server-Side Members
Type
Name
Description
Boolean
AutoSwitchFrom
Auto switch from if you pick up a better weapon.
Boolean
AutoSwitchTo
Auto switch to if we pick it up.
Integer
Weight
Decides whether we should switch from/to this.
Client-Side Members
Type
Name
Description
Number
BobScale
The scale of the viewmodel bob (1.0 default).
Boolean
DrawAmmo
Should draw the default HL2 ammo counter.
Boolean
DrawCrosshair
Should draw the default crosshair.
Integer
Slot
Slot in the weapon selection menu.
Integer
SlotPos
Position in the slot.
Float
SwayScale
The scale of the viewmodel sway (1.0 default).
String
WepSelectIcon
Path to an texture. Override this in your SWEP to set the icon in the weapon selection.