Skip to main content

ChangedRole

Gets called when the player's role has changed.

Start a script sectionโ€‹

!-- OnEvent ChangedRole
-- require @evPlayer $evOldRole *evNewRole $evChangeReason &evSpawnFlags

# Add your instructions here
  • Group: PlayerEvents
  • Cancellable: No
  • Event data: PlayerChangedRoleEventArgs

Injected variablesโ€‹

VariableTypeDescription
@evPlayerplayer valueGets the player whose role changed.
$evOldRoleRoleTypeId enum valueGets the old role type.
*evNewRolereference to PlayerRoleBase objectGets the new role object of the player.
$evChangeReasonRoleChangeReason enum valueGets the reason of role changed.
&evSpawnFlagscollection of RoleSpawnFlags enum valuesGets the spawn flags used for this role change.

Validated examples using this eventโ€‹