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
  • Objectives

SetDurationTime

Sets how long a timer should last.

Scope

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

Syntax

MFK
Lua
SetDurationTime( time );
Game.SetDurationTime( time )
  • time: The duration (in seconds) that the stage should last.

Examples

MFK
Lua
AddStage();
	AddObjective("timer");
		// This stage will complete after 5 seconds have passed.
		SetDurationTime(5);
	CloseObjective();
CloseStage();
Game.AddStage()
	Game.AddObjective("timer")
		-- This stage will complete after 5 seconds have passed.
		Game.SetDurationTime(5)
	Game.CloseObjective()
Game.CloseStage()

Notes

Mods can use the Additional Script Functionality hack to replace this command with one that supports decimal numbers.

See SetDurationTime for details on that hack's implementation.