Games > The Simpsons Hit & Run > Console File Commands > MFK Commands > Levels > Ped Groups > CreatePedGroup

CreatePedGroup

This command creates a ped group that can be populated with subsequent calls to AddPed.

Context

This command should be called in a level's initialisation script (leveli.mfk).

Additionally, this should be followed by at least one call to AddPed and a call to ClosePedGroup.

Syntax

CreatePedGroup( index );

Game.CreatePedGroup( index )

  • index: The index of the ped group.

Examples

// Example from missions/level01/leveli.mfk
CreatePedGroup(0);
	AddPed("male6", 2);
	AddPed("girl4", 1);
	AddPed("fem4", 2);
	AddPed("boy3", 2);
ClosePedGroup();

-- Example from missions/level01/leveli.mfk
Game.CreatePedGroup(0)
	Game.AddPed("male6", 2)
	Game.AddPed("girl4", 1)
	Game.AddPed("fem4", 2)
	Game.AddPed("boy3", 2)
Game.ClosePedGroup()

Notes

By default, there are a maximum of 10 ped groups and the index can only be 0 through 9.

As of Version 1.25, the Mod Launcher's Custom Limits hack can be used to increase the maximum amount of ped groups.

Donut Team © 2024 · v4.0