Skip to main content

ChangingRole

Gets called when the player's role is changing.

Start a script section

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

# Add your instructions here
  • Group: PlayerEvents
  • Cancellable: Yes
  • Event data: PlayerChangingRoleEventArgs

Injected variables

VariableTypeDescription
@evPlayerplayer valueGets the player whose role is changing.
*evOldRolereference to PlayerRoleBase objectGets the old role object of the player.
$evNewRoleRoleTypeId enum valueGets the new role type.
$evChangeReasonRoleChangeReason enum valueGets the reason of role change.
&evSpawnFlagscollection of RoleSpawnFlags enum valuesGets or sets the spawn flags for this role change.
$evIsAllowedbool valueWhether the event is allowed to run.