Skip to content

Class Generator

Create sub-roles and specialized classes for your factions, such as 'Medic' or 'Officer'.


Overview

Use this tool to generate the Lua structure for your custom class. Once generated, the code should be placed in a new file within your schema's classes directory.

Recommended Placement:

garrysmod/gamemodes/[schema folder]/schema/classes/[class_name].lua

The unique identifier for this class (e.g., CLASS_POLICEOFFICER)
The faction index this class belongs to (e.g., FACTION_POLICE)
Joining requires an admin to grant access via /classwhitelist. Has no effect if Is Default is also set.
Automatically assigned to new characters in this faction. Only one class per faction should have this set.
Max concurrent players in this class. 0 = unlimited.
Model path(s). A single entry defaults to that model automatically; multiple entries let players choose one in the classes menu.
Comma-separated RGB values (0-255). Leave empty to use faction color.
Skin index applied to the class model preview. Default is 0.
Bodygroup values forcibly applied to a character each time they spawn in this class. Each entry is a bodygroup ID and the value to set it to.
Sub-material overrides forcibly applied to a character each time they spawn in this class. Each entry is a slot (1-indexed) and the material path to assign.
Material path for the class logo displayed in the scoreboard.
Model scale multiplier. Also adjusts view offset proportionally. Default is 1.
Base health. Overrides faction value when set.
Base armor. Overrides faction value when set.
Salary amount per paycheck. Overrides faction pay when set.
Blood color constant applied on spawn. Leave default unless the class is non-human.
Overrides faction value. When multiplier is checked, multiplies against the config default.
Overrides faction value. When multiplier is checked, multiplies against the config default.
Overrides faction value. When multiplier is checked, multiplies against the player's current jump power.
Weapons given on spawn. Additive with faction weapons — both sets are given, this does not replace them.
If true, this class is not shown as a row in the scoreboard.
Players in this class can use the faction invite system without needing the Z privilege flag.
Players in this class can use the class invite system without needing the X privilege flag.
When set, replaces all faction NPC relations entirely. Absent = all NPCs are hostile (D_HT) by default.
Command names (registered via lia.command.add) that members of this class can execute, bypassing normal privilege checks.

Generated Code