Skip to content

nut.faction

Faction System.

Handles player factions/teams including whitelists, models, and team management. Factions are just a wrapper over the normal team library. Essentially, each faction associates a table with a team. So, extra information can be stored for teams (e.g. salary, descriptions, etc...). See also Faction Development

Functions

nut.faction.loadFromDir (directory)
nut.faction.loadFromDir

Internal

This is used internally - although you're able to use it you probably shouldn't.

Loads faction definitions from a directory

Parameters:

string directory Path to scan for faction files

nut.faction.get (identifier)
nut.faction.get

Gets a faction by index or uniqueID

Parameters:

vararg identifier Faction index (int) or uniqueID (string)

Returns:

table Faction definition table

nut.faction.getIndex (uniqueID)
nut.faction.getIndex

Gets a faction's numeric index by uniqueID

Parameters:

string uniqueID Faction uniqueID

Returns:

number Faction index

nut.faction.formatModelData ()
nut.faction.formatModelData

Internal

This is used internally - although you're able to use it you probably shouldn't.

Formats the bodygroup data into a uniform style.
This allows bodygroup data per model to be submitted in 3 ways:

  1. As a string ("0121200")
  2. As a table with the bodygroup ID as the key {[1] = 2, [2] = 1, [3] = 2, [4] = 0}
  3. As a table with the bodygroup name as the key {head = 2, shoulders = 1, knees = 2, toes = 0}

nut.faction.hasWhitelist (faction)
nut.faction.hasWhitelist

Checks if local player has whitelist for a faction

Parameters:

number faction Faction index to check

Returns:

bool Whether player has whitelist