Skip to content

RoleDefinition

Roles are… well they’re roles. Gamemodes can define roles and specify them in the Roles field of the GamemodeDefinition.

See also: Classes.Role

Type: "RoleDefinition"

Always set to “RoleDefinition”. Used to differentiate between classes.

Type: string

The internal name of the role. This should match the key used in the Roles field of the GamemodeDefinition.

Type: string?

The display name of the role. If not set, the name will be used as the display name.

Type: string

The description of the role. This is shown as a hint when a player is assigned this role.

Type: Color3

The color of the role. This is used to color the role in the UI.

Type: Sound

The sound that plays for players when they receive this role.

Type: boolean?

If true, mentions of this role will have an exclamation mark where appropriate.

Type: string?

The plural form of the role name. If not set, the singular name will be used, with an “s” appended to the end.

Type: boolean?

If true, the number of this role is announced to all players when the round starts.

Type: boolean?

If true, comrades will be revealed in a notification to one another when the round starts.

Type: boolean?

If true, this role is evil. Gamemodes and maps often use this to determine whether a player should be allowed to do certain actions.

Type: boolean?

If true, this role can use action nodes.

Type: boolean?

If true, this role is allowed to do suspicious actions. These are largely up to the discretion of maps / gamemodes, but notably this also determines whether holding a suspicious item will mark the player as a free kill or not.

Type: VictorType

The allegiance of the role. This determines who is considered the winner when the round ends.

Type: {AnyItemDefinition}?

A list of items that this role starts with.

Type: number?

The number of credits that this role starts with. This is added on to their current credits.

Type: {AnyItemDefinition}?

A list of items that this role can buy from the equipment shop.

Type: boolean?

If true, an public announcement is made when a player with this role disconnects, revealing their role.

Type: boolean?

If true, this role can steal credits from corpses.

Type: boolean?

If true, this role will see a list of players who are dead, but no confirmed dead, as missing in action. Otherwise, these players are shown as alive.

Type: boolean?

If true, players with this role can privately chat to others with this role. This only applies to the specific role, not the allegiance.

Type: {[RoleName]: number}?

A map of roles to the number of credits they get when a player with this role dies.

Type: boolean?

If true, self defense is never shown on the corpse of this role.

Type: boolean?

If true, all players are able to see the results of a corpse search when a player with this role searches a corpse.

Type: number?

Sets the walk speed for this role. If not set, the default walk speed is used.

Type: number?

Sets the jump power for this role. If not set, the default jump power is used.

Type: number?

Sets the health for this role. If not set, the default health is used.

Type: {string}?

A list of asset strings that this role will wear.

Type: number?

Dealing incorrect damage to this role will multiply the karma loss by this value. Defaults to 1.

Type: {RoleName}?

A list of roles that are considered allies. Damage to allies is considered incorrect (with exceptions).

Type: {RoleName}?

A list of roles that are automatically revealed to this role.

Type: {RoleName}?

A list of roles that are automatically highlighted for this role.

Hooks are called on (or before) a specific event occuring. All hooks are optional.

Runs when a player receives this role.

NameTypeDescription
roleDefinitionRoleDefinitionThe role.
participantParticipantThe participant.