Modme Forums

Shootable Music Easter Egg

Game Modding | Call of Duty: Black Ops 3 | General Discussion


ModmeBot:

Thread By: greeNTheBoyz
The title states it all. Is there a way to shoot five models around the map and after that initiate music? I'm going to use The Gift (Theatrical) as the music, so I'll probably have to add it myself.


ModmeBot:

Reply By: Durnald Turnip

function init() {
    level.shootablesNeeded = 5;
    level.shootablesCollected = 0;

    trig1 = GetEnt("shootable_trig", "targetname");
    trig2 = GetEnt("shootable_trig_2", "targetname");
    trig3 = GetEnt("shootable_trig_3", "targetname");
    trig4 = GetEnt("shootable_trig_4", "targetname");
    trig5 = GetEnt("shootable_trig_5", "targetname");


    trig1 thread teddieThink();
    trig2 thread teddieThink();
    trig3 thread teddieThink();
    trig4 thread teddieThink();
    trig5 thread teddieThink();

    thread listenForMusicEEDone();
}

function teddieThink() {
    self SetHintString(""); // not needed
    self SetCursorHint("HINT_NOICON");

    self waittill("trigger");

    IPrintLn(""); // put in whatever you want in quotes, not needed

    foreach(player in GetPlayers()) player PlaySoundToPlayer("alias", player); // sound to play when activated

    level.shootablesCollected++;

    self delete();
}

function listenForMusicEEDone() {
    while(level.shootablesCollected < level.shootablesNeeded) wait 1;

    foreach(player in GetPlayers()) player PlaySoundToPlayer("alias", player); // song to be played
}

Credits to my man DuBCraft21 for helping me out with this script for my map.

Any errors/questions just ask.


ModmeBot:

Reply By: Hero115

Durnald
function init() {
    level.shootablesNeeded = 5;
    level.shootablesCollected = 0;

    trig1 = GetEnt("shootable_trig", "targetname");
    trig2 = GetEnt("shootable_trig_2", "targetname");
    trig3 = GetEnt("shootable_trig_3", "targetname");
    trig4 = GetEnt("shootable_trig_4", "targetname");
    trig5 = GetEnt("shootable_trig_5", "targetname");


    trig1 thread teddieThink();
    trig2 thread teddieThink();
    trig3 thread teddieThink();
    trig4 thread teddieThink();
    trig5 thread teddieThink();

    thread listenForMusicEEDone();
}

function teddieThink()
{
    self SetHintString(""); // not needed
    self SetCursorHint("HINT_NOICON");

    self waittill("trigger");

    IPrintLn(""); // put in whatever you want in quotes, not needed

    foreach(player in GetPlayers()) player PlaySoundToPlayer("alias", player); // sound to play when activated

    level.shootablesCollected++;

    self delete();
}

function listenForMusicEEDone() 
{
    while(level.shootablesCollected < level.shootablesNeeded)
    wait 1;

    foreach(player in GetPlayers()) player PlaySoundToPlayer("alias", player); // song to be played
}

Credits to my man DuBCraft21 for helping me out with this script for my map.

Any errors/questions just ask.


If you don't want a Hintstring then please delete this part or at least comment it like this :

// self SetHintString(""); // not needed
// self SetCursorHint("HINT_NOICON");

It's better that's way. Just for the sake of cleaning.

Same goes with :

// IPrintLn(""); // put in whatever you want in quotes, not needed