Skip to main content

Participant

A Participant represents a player in the round. You can get a Participant using the GetParticipant API.

Properties

NameTypeDescription
ExtrasExtrasExtra data for the participant.
PlayerPlayerThe player associated with this participant.
RoundRoundThe round that this participant is in.
DidParticipatebooleanWhether or not the participant has ever joined the round.
SlayVotes{Participant}A list of participants that have voted to slay this participant after being RDMed by them.
CorpseCorpseThe corpse of this participant.
ExtraCorpseIcons{CorpseIcon}A list of additional corpse icons for this participant.
CorpseSearchDistancenumberThe max distance that the participant can interact with a corpse from.
KillList{Participant}A list of participants that this participant has killed.
ScoresScoreTableA table of scores for this participant.
ItemPurchasesItemPurchasesA table of items that this participant has purchased, to the number of times they have done so.

Methods

TryAddSlayVote

Attempts to add a slay vote to the participant. Will fail if the voter has already voted against this participant, or if the voter was not RDMed by this participant.

Parameters

NameTypeDefaultDescription
voterParticipantThe participant that is voting to slay this participant.

Returns

boolean

TryPlayAnimation

Attempts to play an animation on the participant's character.

Parameters

NameTypeDefaultDescription
animationIdnumberThe ID of the animation to play.
animationNamestringThe name of the animation.

Returns

()

TryStopAnimation

Attempts to stop the animation with the given name on the participant's character.

Parameters

NameTypeDefaultDescription
animationNamestringThe name of the animation to stop.

Returns

()

GetKarma

Returns the karma of the participant. Returns 1000 if karma is not enabled in the current gamemode.

Returns

number

SetKarma

Sets the karma of the participant. No effect if karma is disabled in the current gamemode.

Parameters

NameTypeDefaultDescription
karmanumberThe karma to set.

Returns

()

IsFreeKill

Returns true if the participant is a free kill.

Returns

boolean

SetFreeKill

Sets the free kill reason of the participant. Sends a chat message to the participant with the given reason, in the form "Because you {reason}, you are now a free kill!".

Parameters

NameTypeDefaultDescription
reasonstring?The reason to set, or nil if the participant should no longer be a free kill.

Returns

()

GetRole

Returns the role of the participant. If the Participant has not yet been assigned a role, returns the default role as defined by the game (not the gamemode).

Returns

string

SetRole

Sets the role of the participant to the given role definition. Unsets the role if no definition is given.

Parameters

NameTypeDefaultDescription
roleDefinitionRoleDefinition?The role definition. Unsets the role if nil.

Returns

()

IsBadGuy

Returns true if the participant's role is a bad guy. The default role is not set to be a bad guy.

Returns

boolean

IsAlliedWithParticipant

Returns true if the participant is allied with the given participant.

Parameters

NameTypeDefaultDescription
participantParticipantThe participant to check.

Returns

boolean

IsDamageJustifiedAgainstParticipant

Returns true if the participant is justified to deal damage to the given participant. Damage is justified if the participant is not allied with the target, or if the participant has self-defense against the target.

Parameters

NameTypeDefaultDescription
targetParticipantThe participant to check.

Returns

boolean

GetFormattedName

Returns the participant's username, formatted with their role colour.

Returns

string

AddCorpseIcon

Adds a corpse icon when the participant is killed. This should be called before the participant is killed.

Parameters

NameTypeDefaultDescription
corpseIconCorpseIconThe corpse icon to add.

Returns

()

GetCharacter

Returns the participant's character. Returns nil if the participant has no character.

Returns

Model?

GetHumanoid

Returns the participant's humanoid. Returns nil if the participant has no humanoid.

Returns

Humanoid?

SpawnCharacter

Spawns or respawns the participant's character. The character will spawn at a random PlayerSpawn in the map.

Returns

()

UnspawnCharacter

Unspawns the participant's character. No effect if the participant has no character.

Returns

()

AddSelfDefenseEntry

Adds a self-defense entry against the specified participant for the specified duration.

Parameters

NameTypeDefaultDescription
paramsSelfDefenseParamsThe params.

Returns

()

HasSelfDefenseAgainstParticipant

Returns true if the participant has self-defense against the specified participant.

Parameters

NameTypeDefaultDescription
participantParticipantThe participant to check.

Returns

boolean

SetLastDamagedBy

Sets the participant's last attacker for the specified duration. If the participant dies to environmental causes within the specified duration, their death will be attributed to the attacker.

Parameters

NameTypeDefaultDescription
attackerParticipantThe attacker.
durationnumberThe duration.

Returns

()

AddScore

Adds the specified amount of score, for the specified reason, to the Participant.

Parameters

NameTypeDefaultDescription
reasonstringThe reason.
amountnumberThe amount. Can be negative.

Returns

()

AddCredits

Adds the specified amount of credits to the Participant.

Parameters

NameTypeDefaultDescription
amountnumberThe amount. Can be negative.

Returns

()

SetCredits

Sets the participant's credits to the specified amount.

Parameters

NameTypeDefaultDescription
amountnumberThe amount.

Returns

()

DropAmmoBoxForCurrentItem

Attempts to drop an ammo box for the participant's current item. Will fail if no item is held or if the current item cannot drop an ammo box.

Returns

()

GetEquippedItem

Returns the participant's currently equipped item. Returns nil if the participant has no item equipped.

Returns

AnyItem?

SetEquippedItem

Attempt to set the participant's currently equipped item.

Parameters

NameTypeDefaultDescription
itemAnyItemThe item.
forceboolean?Whether to force set the item, bypassing prevent unequip if the currently equipped item has it.

Returns

()

GetItems

Returns a table of the item name to the item, for all items in the participant's inventory.

Returns

{[string]: AnyItem}

GiveItemFromItemDefinition

Gives the specified item to the participant. Will error if the item cannot be given.

Parameters

NameTypeDefaultDescription
itemDefinitionItemDefinitionThe item definition.

Returns

()

DropItem

Attempts to drop the specified item. Will fail if the item cannot be dropped.

Parameters

NameTypeDefaultDescription
itemAnyItemThe item.
throwDirectionVector3?The direction to throw the item.

Returns

()

AddItem

Adds the item to the participant's inventory. Will error if the slot is already occupied.

Parameters

NameTypeDefaultDescription
itemAnyItemThe item.

Returns

()

RemoveItem

Removes the item from the participant's inventory.

Parameters

NameTypeDefaultDescription
itemAnyItemThe item.

Returns

()

TryDropItem

Attempts to drop the specified item. If unsuccessful, removes the item instead. Returns true if the item was dropped.

Parameters

NameTypeDefaultDescription
itemAnyItemThe item.
throwboolean?Whether to apply a throwing force or not.

Returns

boolean

IsItemSlotOccupied

Returns true if the specified item slot is occupied.

Parameters

NameTypeDefaultDescription
slotnumberThe slot.

Returns

boolean

GetAmmo

Returns the amount of the specified ammo type the participant has. Returns 0 for invalid ammo types.

Parameters

NameTypeDefaultDescription
ammoTypestringThe ammo type.

Returns

number

SetAmmo

Sets the amount of the specified ammo type the participant has.

Parameters

NameTypeDefaultDescription
ammoTypestringThe ammo type.
amountnumberThe amount.

Returns

()

GetAllAmmo

Returns a table of the ammo type to the amount of ammo the participant has.

Returns

{[string]: number}

HasWeaponOfAmmoType

Returns true if the participant has a weapon with the specified ammo type.

Parameters

NameTypeDefaultDescription
ammoTypestringThe ammo type.

Returns

boolean

PurchaseItem

Attempts to purchase the specified item definition. Returns an ItemPurchaseResult.

Parameters

NameTypeDefaultDescription
itemDefinitionItemDefinitionThe item definition.

Returns

ItemPurchaseResult

GetStatus

Returns the status of the participant.

Returns

ParticipantStatus

IsAlive

Returns true if the participant is alive.

Returns

boolean

TryTakeDamage

Attempts to deal damage, with the specified parameters. Returns true if the damage was successful.

Parameters

NameTypeDefaultDescription
paramsDamageParamsThe damage parameters.

Returns

boolean

GetHealth

Returns the health of the participant. Returns 0 if the participant has no humanoid.

Returns

number

SetHealth

Sets the health of the participant. Will automatically set the Humanoid.MaxHealth if needed.

Parameters

NameTypeDefaultDescription
healthnumberThe health.

Returns

()

MoveToSpawn

Teleports the participant to a PlayerSpawn on the map.

Returns

()

TryThrowAssembly

Attempts to throw the specified assembly. Returns true if successful.

Parameters

NameTypeDefaultDescription
assemblyAssemblyThe assembly.
forcenumberThe force of the throw.
parentInstance?The parent to set for the assembly.
positionVector3?The initial position of the assembly.
directionVector3?The direction to throw the assembly.
noForwardboolean?Whether to teleport the assembly slightly in-front of the participant.

Returns

boolean