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
  • Mission Initialisation
  • Stages

AddStageTime

Adds more time to the timer upon reaching a stage.

Scope

This command should be called between calls to AddStage and CloseStage in a mission's initialisation script.

Syntax

MFK
Lua
AddStageTime( time );
Game.AddStageTime( time )
  • time: The amount of time, in seconds, to add to the active stage timer.
    • The game adds 1 to whatever value you specify here, meaning 0 will actually result in the game adding 1 second.
    • If this quirk bothers you, you can instead use -1.

Examples

MFK
Lua
SelectMission("m1");
	// ...

	AddStage();
		// Set the stage timer to 60 seconds here.
		SetStageTime(60);
		
		AddObjective("dummy");
		CloseObjective();
	
	CloseStage();
	
	AddStage();
		// Then add 30 seconds to the stage timer when reaching this stage.
		AddStageTime(30);
	
		AddObjective("dummy");
		CloseObjective();
	CloseStage();
CloseMission();
Game.SelectMission("m1")
	-- ...

	Game.AddStage()
		-- Set the stage timer to 60 seconds here.
		Game.SetStageTime(60)
		
		Game.AddObjective("dummy")
		Game.CloseObjective()
	Game.CloseStage()
	
	Game.AddStage()
		-- Then add 30 seconds to the stage timer when reaching this stage.
		Game.AddStageTime(30)
	
		Game.AddObjective("dummy")
		Game.CloseObjective()
	Game.CloseStage()
Game.CloseMission()

Notes

  • In order to actually fail the player when they run out of time in a stage, you must also add a timeout condition in the stage.
  • If there was no stage timer prior to reaching the stage, then this commands functions basically the same as SetStageTime.