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
Properties
Section titled “Properties”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.
DisplayName
Section titled “DisplayName”Type: string?
The display name of the role. If not set, the name will be used as the display name.
Description
Section titled “Description”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.
IsExclamatory
Section titled “IsExclamatory”Type: boolean?
If true, mentions of this role will have an exclamation mark where appropriate.
PluralName
Section titled “PluralName”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.
ShouldAnnounceRoleCount
Section titled “ShouldAnnounceRoleCount”Type: boolean?
If true, the number of this role is announced to all players when the round starts.
ShouldRevealComradeList
Section titled “ShouldRevealComradeList”Type: boolean?
If true, comrades will be revealed in a notification to one another when the round starts.
IsEvil
Section titled “IsEvil”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.
CanUseActionNodes
Section titled “CanUseActionNodes”Type: boolean?
If true, this role can use action nodes.
CanDoSuspiciousActions
Section titled “CanDoSuspiciousActions”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.
Allegiance
Section titled “Allegiance”Type: VictorType
The allegiance of the role. This determines who is considered the winner when the round ends.
StartingItems
Section titled “StartingItems”Type: {AnyItemDefinition}?
A list of items that this role starts with.
StartingCredits
Section titled “StartingCredits”Type: number?
The number of credits that this role starts with. This is added on to their current credits.
EquipmentShop
Section titled “EquipmentShop”Type: {AnyItemDefinition}?
A list of items that this role can buy from the equipment shop.
ShouldAnnounceDisconnect
Section titled “ShouldAnnounceDisconnect”Type: boolean?
If true, an public announcement is made when a player with this role disconnects, revealing their role.
CanStealCreditsFromCorpses
Section titled “CanStealCreditsFromCorpses”Type: boolean?
If true, this role can steal credits from corpses.
CanSeeMissingInAction
Section titled “CanSeeMissingInAction”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.
CanTeamChat
Section titled “CanTeamChat”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.
AwardCreditsToRolesOnDeath
Section titled “AwardCreditsToRolesOnDeath”Type: {[RoleName]: number}?
A map of roles to the number of credits they get when a player with this role dies.
CorpseHidesSelfDefense
Section titled “CorpseHidesSelfDefense”Type: boolean?
If true, self defense is never shown on the corpse of this role.
CorpseSearchResultsPublicised
Section titled “CorpseSearchResultsPublicised”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.
WalkSpeed
Section titled “WalkSpeed”Type: number?
Sets the walk speed for this role. If not set, the default walk speed is used.
JumpPower
Section titled “JumpPower”Type: number?
Sets the jump power for this role. If not set, the default jump power is used.
Health
Section titled “Health”Type: number?
Sets the health for this role. If not set, the default health is used.
Accessories
Section titled “Accessories”Type: {string}?
A list of asset strings that this role will wear.
DamageKarmaMultiplier
Section titled “DamageKarmaMultiplier”Type: number?
Dealing incorrect damage to this role will multiply the karma loss by this value. Defaults to 1.
Allies
Section titled “Allies”Type: {RoleName}?
A list of roles that are considered allies. Damage to allies is considered incorrect (with exceptions).
RevealedRoles
Section titled “RevealedRoles”Type: {RoleName}?
A list of roles that are automatically revealed to this role.
HighlightedRoles
Section titled “HighlightedRoles”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.
OnRoleAssignedServer
Section titled “OnRoleAssignedServer”Runs when a player receives this role.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| roleDefinition | RoleDefinition | The role. |
| participant | Participant | The participant. |