1. Go in radiant and place a trigger/use , select it, press N and give it the following KVP
key:targetname
value:toilet_trig
Done with radiant.
2. Get two sounds, the first sound for the toilet flush sound, and the second sound for the actual song you want to play for your
easter egg. After you convert them in Audacity(or whatever you use to convert your sounds), and after you have included them in your mapname
(literally when you've finished adding your sounds) open your
CoD WaW Root/mods/ YOUR MAP NAME/maps/ YOUR MAP NAME.gsc
3. Go to the bottom of that file, copy the code below and paste it
toilet_flush()
{
trig = GetEnt( "toilet_trig","targetname" );
num = 0;
trig SetHintString( "" );
trig SetCursorHint( "HINT_NOICON" );
trig UseTriggerRequireLookAt( );
while( true )
{
players = get_players( );
trig waittill( "trigger", players );
PlaySoundAtPosition( "toilet_flush", trig.origin);
num = num + 1;
trig disable_trigger( );
wait 4;
trig enable_trigger( );
if( num == 3)
{
players PlaySound( "cha_ching" );
trig Delete( );
players PlaySound( "verruckt_sound" );
}
}
}
/*
trig SetHintString( "" ); you can put a Hint String inside the brackets if you want EX: Press and old &&1 to press the toilet button
trig SetCursorHint( "HINT_NOICON" ); you can remove this line and the default HAND ICON will appear when you're near the trigger
PlaySoundAtPosition( "toilet_flush", trig.origin); change the toilet_flush to the name of your flush sound alias
wait 4; put the length of your flush sound here
if( num == 3) change the 3 to the number of how many times you want the player to press the trigger in order to play the sound
players PlaySound( "verruckt_sound" ); change the verruckt_sound to the name of the soundalias of the song you want to play
*/
4. Then scroll up until you find FUNCTION CALLS PRE-LOAD and paste this line underneath
5. Save the file, build your mod, compile the map and DONE. Go in game and check if it worked.
NOTE: It doesn't mean that it has to be a trigger/use, it could be a trigger damage instead, but since in verruckt it is a trigger use
i did the same for the sake of this tutorial. No need for any credit anyway.
Well, that's it, worked fine for me, should do the same with you.
How to add custom sounds on your map ---->
https://www.youtube.com/watch?v=wVmWFarXQpk