Modding Tools > Lucas' Simpsons Hit & Run Mod Launcher > Hacks > Mod Requirable Hacks > Additional Script Functionality > MFK Commands > Objectives > SetObjSound

SetObjSound

Set a sound to use for a hitpeds objective or the insidetrigger / outsidetrigger objectives.

Context

This command should be called between calls to AddObjective and CloseObjective.

Syntax

hitpeds Objective

SetObjSound( sound );

Game.SetObjSound( sound )

  • sound: The name of the daSoundResourceData to play.

insidetrigger / outsidetrigger Objectives

SetCondSound( sound, event, [time_between, start_delay] );

Game.SetCondSound( sound, event, [time_between, start_delay] )

  • sound: The name of the daSoundResourceData to play.
  • event: The event to play the sound on.
    • enter_trigger: Play the sound when entering the trigger.
    • inside_trigger: Play the sound when inside the trigger
      • Only for "insidetrigger" objectives.
    • outside_trigger: Play the sound when outside the trigger
      • Only for "outsidetrigger" objectives.
    • exit_trigger: Play the sound when exiting the trigger.
  • time_between: The time between each time the sound plays in second
    • Only for "inside_trigger" or "outside_trigger" events.
  • start_delay: The delay before the sound starts playing after entering/exiting the trigger in seconds
    • Only for "inside_trigger" or "outside_trigger" events.

Examples

hitpeds Objective

AddObjective("hitpeds");
	AddObjSound("generic_car_explode");
CloseObjective();

Game.AddObjective("hitpeds")
	Game.AddObjSound("generic_car_explode")
Game.CloseObjective()

insidetrigger / outsidetrigger Objectives

AddObjective("insidetrigger");
	SetObjTrigger("z2phone1");

	SetObjSound("enter_trigger","gag_alm2");
	SetObjSound("inside_trigger","countdown_beeps",1,5);
	SetObjSound("exit_trigger","P_HitByC_Mrg_01");
CloseObjective();

Game.AddObjective("insidetrigger")
	Game.SetObjTrigger("z2phone1")

	Game.SetObjSound("enter_trigger","gag_alm2")
	Game.SetObjSound("inside_trigger","countdown_beeps",1,5)
	Game.SetObjSound("exit_trigger","P_HitByC_Mrg_01")
Game.CloseObjective()

Notes

No additional notes.

Version History

1.18

Added this command.

Donut Team © 2024 · v4.0