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

AddPed

This command adds a ped to a ped group.

Scope

This command should be called between calls to CreatePedGroup and ClosePedGroup in a level's initialisation script.

Syntax

MFK
Lua
AddPed( character, amount );
Game.AddPed( character, amount )
  • character: The name of the character to add to the ped group.
  • amount: The maximum amount of this character that will be able to spawn.

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

You can add up to 10 unique models to a ped group. Subsequent calls to this command will be ignored.