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
  • Modding Tools
  • Lucas' Simpsons Hit & Run Mod Launcher
  • Hacks
  • Mod Requirable Hacks
  • Additional Script Functionality
  • Console Commands
  • MFK Commands
  • Mission Initialisation
  • Stages
  • Objectives

SetObjFailDistance

Available since Version 1.27.

Set the maximum distance the player can be from the stage vehicle in a dump objective that uses BindCollectibleTo to make the stage vehicle drop stuff near specific waypoints.

Scope

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

Syntax

MFK
Lua
SetObjFailDistance( fail_distance );
Game.SetObjFailDistance( fail_distance )
  • fail_distance: The maximum distance the player can be from the vehicle before they fail.
    • The default value without calling this command is 200.
    • Use 0 to disable failing the player regardless of distance.

Examples

MFK
Lua
AddObjective("dump");
	SetObjTargetVehicle("snake_v");

	// Do not fail the player regardless of how far they get from snake_v
	SetObjFailDistance(0);

	AddCollectible("m5_collectible_1", "jeans");
	AddCollectible("m5_collectible_2", "molemanr");

	BindCollectibleTo(0, 0);
	BindCollectibleTo(1, 1);
CloseObjective();
Game.AddObjective("dump")
	Game.SetObjTargetVehicle("snake_v")

	-- Do not fail the player regardless of how far they get from snake_v
	Game.SetObjFailDistance(0)

	Game.AddCollectible("m5_collectible_1", "jeans")
	Game.AddCollectible("m5_collectible_2", "molemanr")

	Game.BindCollectibleTo(0, 0)
	Game.BindCollectibleTo(1, 1)
Game.CloseObjective()