SwitchRoleOnUse
CustomFlag: SwitchRoleOnUse
Description When the item is used, this setting can switch the player's role (class) after an optional delay. Supports switching to built-in roles or to custom role systems (UCR/ECR).
Parameters
delay—float?— Seconds to wait before the role switch occurs. Default:1.role_type—string?—"UCR"or"Normal". Leave blank to use default behavior. Default:"".role_id—uint?— Role identifier. Ifrole_typeisNormal, this should be theRoleTypeenum value. Ifrole_typeisUCR/ECR, this should be the custom role ID. Default:1.spawn_flags—RoleSpawnFlags?— ForNormalrole types, controls how the new role spawns:None,AssignInventory,UseSpawnpoint, orAll. Default:None.keep_location—bool?— Iftrue, the player remains at their current position after the role change (useful for role swaps without teleporting). Default:false.
Behavior notes
Delayallows for animations/sfx before the switch completes.When using
role_type: Normal,spawn_flagsdetermines whether to give the new role its normal inventory, spawnpoint, or both.RoleIdmust match the expected identifier for the selectedrole_type. Be careful mixingNormalandUCRwithout correct IDs.
Example Yaml context
flag_settings:
switch_role_on_use_settings:
- delay: 6
role_type: "Normal"
role_id: 0
spawn_flags: "None"
keep_location: trueLast updated
Was this helpful?