Skip to main content

CRole.CreateProceduralSpawnSystem

Creates a procedural spawn system for a custom role.

Syntax

CRole.CreateProceduralSpawnSystem role_to_replace per_player_spawn_chance conversion_limit? minimum_required_players?

Returns

reference to CustomRoleSpawnSystem object

Arguments

NameRequiredTypeDescription
role to replaceYesRoleTypeId enum value - found using 'serhelp RoleTypeId' commandThis decides which base-game role will be replaced by a custom role.
per player spawn chanceYesA number between 0% and 100% (inclusive)Example: setting conversion chance to 30% means that EACH player has a 30% chance to convert.
conversion limitNoA whole number bigger or equal 0The maximum amount of players that can convert.
minimum required playersNoA whole number bigger or equal 0The minimum amount of players that must have the 'role to replace' when the round starts for the conversion to happen.

Details

This spawn system works only when the round starts.

Validated examples using this method

On a running server

Use serhelp CRole.CreateProceduralSpawnSystem to inspect the reference generated by your installed SER version.