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

BindCollectibleTo

This command binds a collectible in a dump objective to a waypoint.

Calling this command disables the player's ability to knock collectibles out of the car by slamming into it, so all collectibles in the stage must be bound to waypoints.

Scope

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

Syntax

MFK
Lua
BindCollectibleTo( collectible_index, waypoint_index );
Game.BindCollectibleTo( collectible_index, waypoint_index )
  • collectible_index: The 0-based index of the collectible.
  • waypoint_index: The 0-based index of the waypoint to bind the collectible to.

Examples

MFK
Lua
AddStageWaypoint("m5_AI_path_4");
AddStageWaypoint("m5_AI_path_7");
AddStageWaypoint("m5_AI_path_10");
AddStageWaypoint("m5_AI_path_16");

AddObjective("dump");
	SetObjTargetVehicle("snake_v");
	AddCollectible("m5_collectible_1", "jeans");
	AddCollectible("m5_collectible_2", "molemanr");
	AddCollectible("m5_collectible_3", "h_soda");
	BindCollectibleTo(0, 0); // jeans will drop when snake_v gets near m5_AI_path_4
	BindCollectibleTo(1, 1); // molemanr will drop when snake_v gets near m5_AI_path_7
	BindCollectibleTo(2, 2); // h_soda will drop when snake_v gets near m5_AI_path_10
CloseObjective();
Game.AddStageWaypoint("m5_AI_path_4")
Game.AddStageWaypoint("m5_AI_path_7")
Game.AddStageWaypoint("m5_AI_path_10")
Game.AddStageWaypoint("m5_AI_path_16")

Game.AddObjective("dump")
	Game.SetObjTargetVehicle("snake_v")
	Game.AddCollectible("m5_collectible_1", "jeans")
	Game.AddCollectible("m5_collectible_2", "molemanr")
	Game.AddCollectible("m5_collectible_3", "h_soda")
	Game.BindCollectibleTo(0, 0) -- jeans will drop when snake_v gets near m5_AI_path_4
	Game.BindCollectibleTo(1, 1) -- molemanr will drop when snake_v gets near m5_AI_path_7
	Game.BindCollectibleTo(2, 2) -- h_soda will drop when snake_v gets near m5_AI_path_10
Game.CloseObjective()