Donut Team is a labor of love, built and maintained by a small group of passionate developers. We invest our own time and resources to offer our tools, mods, and web services completely free of charge.

We don't run ads, and we will never sell your data - period.

If you've enjoyed anything we've created, please consider supporting our work with a one-time or monthly donation via our Ko-fi page . Every contribution helps us continue building great experiences for the community.

Dismiss
  • Games
  • Radical Entertainment
  • The Simpsons: Hit & Run
  • Scripting
  • Console Commands
  • MFK Commands
  • Level Initialisation
  • Ped Groups

CreatePedGroup

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

Scope

This command should be called in a level's initialisation script.

Syntax

MFK
Lua
CreatePedGroup( index );
Game.CreatePedGroup( index )
  • index: The index of the ped group.

Examples

MFK
Lua
// 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.

You can use the Custom Limits hack to increase the maximum amount of ped groups.