Modme Forums

Add a kvp that plays a sound when a door is activated or purchased?

Game Asset Reversing | Releases


How does one do this?


Write a simple script with a function to wait until the player triggers the door, then make a sound alias and make sure it's a 3D sound, then call PlaySound("your_alias_name") on the door trigger.

//put this anywhere in your zm_usermapname.gsc and call it for each trigger with the trigger targetname KVP below zm_usermap::init();
//ex. thread doorSound("radiant_door_trigger_targetname", "your_sound_alias_name");
function doorSound(doorTrigName, sound){
doorTrig = GetEnt(doorTrigName, "targetname");
if(!isdefined(doorTrig)) return;
level endon("intermission");
doorTrig waittill("door_opened");
doorTrig PlaySound(sound);



with the trigger just add a kvp "script_sound" then "alias_name" (plays a sound once triggerd) no need for FinalKillGamings script

Check here detailed instructions on how to do everything regarding doors and debris