Modme Forums

Easter egg

Game Modding | Call of Duty: Black Ops 3 | Radiant


iamKxcper:

I'm making a zombies map and i'm not really that good in scripting, does anyone know how i can make multiple triggers where i have to press my interaction button and when I've pressed all of them a door opens/disappears?

Also is it possible to make it that when i press the button it plays a sound?


Spiki:

Didn't test but should work.
Something like this:
button_trig is the targetname of the triggers
button_door -targetname of the doors (!!!script models/brushmodels!!!)

thread buttons();

function buttons()
{
buttons = GetEntArray("button_trig","targetname");
doors = GetEntArray("button_door","targetname");

level.door_buttons = 0;

foreach(but in buttons)
    but thread button_logic();

while(level.door_buttons < buttons.size) //wait untill all buttons are pressed
    {
    wait 1;
    }

foreach(door in doors)
    {
    //what to do to all doors
    door ConnectPaths(); //for zombie pathing
    door Delete();
    }
}


function button_logic() //self = trigger
{
self SetHintString("Press &&1 to activate");
self SetCursorHint("HINT_NOICON");

self waittill("trigger");

level.door_buttons++;
}


iamKxcper:

Didn't test but should work.
Something like this:
button_trig is the targetname of the triggers
button_door -targetname of the doors (!!!script models/brushmodels!!!)

thread buttons();

function buttons()
{
buttons = GetEntArray("button_trig","targetname");
doors = GetEntArray("button_door","targetname");

level.door_buttons = 0;

foreach(but in buttons)
    but thread button_logic();

while(level.door_buttons < buttons.size) //wait untill all buttons are pressed
    {
    wait 1;
    }

foreach(door in doors)
    {
    //what to do to all doors
    door ConnectPaths(); //for zombie pathing
    door Delete();
    }
}


function button_logic() //self = trigger
{
self SetHintString("Press &&1 to activate");
self SetCursorHint("HINT_NOICON");

self waittill("trigger");

level.door_buttons++;
}

thanks! i'll try it out right now :)


iamKxcper:

okay so.. i had a problem for a second but i fixed the problem finally, after that i press the button the trigger is still there, do you know how i can make it disappear ? let's say that if button is pressed it deletes itself.


Spiki:

okay so.. i had a problem for a second but i fixed the problem finally, after that i press the button the trigger is still there, do you know how i can make it disappear ? let's say that if button is pressed it deletes itself.


function button_logic() //self = trigger
{
self SetHintString("Press &&1 to activate");
self SetCursorHint("HINT_NOICON");

self waittill("trigger");
self delete();
level.door_buttons++;
}


iamKxcper:

function button_logic() //self = trigger
{
self SetHintString("Press &&1 to activate");
self SetCursorHint("HINT_NOICON");

self waittill("trigger");
self delete();
level.door_buttons++;
}

Thank you so much for the help, this means a lot! :)