Modme Forums
Menu:

Grabbing parts in any order

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


MKD Joker:

Is there a way to script it where instead of picking up parts in order with " model_name waittill( "trigger", player ) " to make it where you can pick them up in any order?


Spiki:

imma need to see more code


tmk_boi:

Is there a way to script it where instead of picking up parts in order with " model_name waittill( "trigger", player ) " to make it where you can pick them up in any order?

YES make only one model and trigger available at a time with model1_name hide; and i have no idea how to enable or discable a trigger but its most likely easy... and then once theyve triggered it hide the trigger and model and then do model2_name show;

actually ill make an example

model1 = getent blalbalba targetname u get it
Trig1 = getent blalbalba targetname u get it
model 2 = getent balblablbalalb
Trig2 = getent balblablbalalb

model 2 hide;
disable trigger here too

trig1.waittill triggered by player
model1 hide;
disable trig1

model 2 show;
enable trig 2


when trig 2 is triggered then do the rest of what u want to do


(sorry if this is bad i dont do gsc lol)


MKD Joker:

imma need to see more code

function step_3()
{
    ladder1 = GetEnt("ladder1", "targetname");
    ladder2 = GetEnt("ladder2", "targetname");
    ladder3 = GetEnt("ladder3", "targetname");
    endagme_model2 = GetEnt("sg4y_endgame2", "targetname");
    endagme_model2_trigger = GetEnt("sg4y_endgame_cable_pickup", "targetname");
    ladder1_trig = GetEnt("ladder1_trig", "targetname");
    ladder2_trig = GetEnt("ladder2_trig", "targetname");
    ladder3_trig = GetEnt("ladder3_trig", "targetname");
    ladder1 Hide();
    ladder2 Hide();
    ladder3 Hide();
    ladder1_trig Hide();
    ladder2_trig Hide();
    ladder3_trig Hide();
    level waittill("mkd_3.1_start");
    ladder1 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder1","targetname").origin);
    ladder1_trig Show();
    ladder1_trig SetCursorHint( "HINT_NOICON" );
    ladder1_trig setHintString( "Press and Hold ^3&&1^7 to Interact");

    // PART ONE - ELECTRIC CHERRY
    ladder1_trig waittill( "trigger", player );
    ladder1_trig Hide();
    ladder1 moveZ(150,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder1","targetname").origin);
    ladder1 Hide();

    // PART TWO - PHD
    ladder2 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder2","targetname").origin);
    ladder2_trig Show();
    ladder2_trig SetCursorHint( "HINT_NOICON" );
    ladder2_trig setHintString( "Press and Hold ^3&&1^7 to Interact");
    ladder2_trig waittill( "trigger", player );
    ladder2_trig Hide();
    ladder2 moveZ(150,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder2","targetname").origin);
    ladder2 Hide();

    // PART THREE - WIDOWS WINE
    ladder3 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder3","targetname").origin);
    ladder3_trig Show();
    ladder3_trig SetCursorHint( "HINT_NOICON" );
    ladder3_trig setHintString( "Press and Hold ^3&&1^7 to Interact");
    ladder3_trig waittill( "trigger", player );
    ladder3_trig Hide();
    ladder3 moveZ(70,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder3","targetname").origin);
    ladder3 Hide();

    endagme_model2 Show();
    endagme_model2_trigger Show();
    endagme_model2 thread zm_powerups::powerup_wobble();
}

Thats how my code is. rn its made so you get one, then the other. but I want it to be able to be picked up in any order.


tmk_boi:

function step_3()
{
    ladder1 = GetEnt("ladder1", "targetname");
    ladder2 = GetEnt("ladder2", "targetname");
    ladder3 = GetEnt("ladder3", "targetname");
    endagme_model2 = GetEnt("sg4y_endgame2", "targetname");
    endagme_model2_trigger = GetEnt("sg4y_endgame_cable_pickup", "targetname");
    ladder1_trig = GetEnt("ladder1_trig", "targetname");
    ladder2_trig = GetEnt("ladder2_trig", "targetname");
    ladder3_trig = GetEnt("ladder3_trig", "targetname");
    ladder1 Hide();
    ladder2 Hide();
    ladder3 Hide();
    ladder1_trig Hide();
    ladder2_trig Hide();
    ladder3_trig Hide();
    level waittill("mkd_3.1_start");
    ladder1 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder1","targetname").origin);
    ladder1_trig Show();
    ladder1_trig SetCursorHint( "HINT_NOICON" );
    ladder1_trig setHintString( "Press and Hold ^3&&1^7 to Interact");

    // PART ONE - ELECTRIC CHERRY
    ladder1_trig waittill( "trigger", player );
    ladder1_trig Hide();
    ladder1 moveZ(150,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder1","targetname").origin);
    ladder1 Hide();

    // PART TWO - PHD
    ladder2 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder2","targetname").origin);
    ladder2_trig Show();
    ladder2_trig SetCursorHint( "HINT_NOICON" );
    ladder2_trig setHintString( "Press and Hold ^3&&1^7 to Interact");
    ladder2_trig waittill( "trigger", player );
    ladder2_trig Hide();
    ladder2 moveZ(150,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder2","targetname").origin);
    ladder2 Hide();

    // PART THREE - WIDOWS WINE
    ladder3 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder3","targetname").origin);
    ladder3_trig Show();
    ladder3_trig SetCursorHint( "HINT_NOICON" );
    ladder3_trig setHintString( "Press and Hold ^3&&1^7 to Interact");
    ladder3_trig waittill( "trigger", player );
    ladder3_trig Hide();
    ladder3 moveZ(70,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder3","targetname").origin);
    ladder3 Hide();

    endagme_model2 Show();
    endagme_model2_trigger Show();
    endagme_model2 thread zm_powerups::powerup_wobble();
}

Thats how my code is. rn its made so you get one, then the other. but I want it to be able to be picked up in any order.

ooooh i thought u want to make it in order... maybe make them all active but when picked up a number to a float/interger gets added and then once the float/int gets to 3 or however many parts u want you should set the flag to be able to build... idk lol


Spiki:

function step_3()
{
    ladder1 = GetEnt("ladder1", "targetname");
    ladder2 = GetEnt("ladder2", "targetname");
    ladder3 = GetEnt("ladder3", "targetname");
    endagme_model2 = GetEnt("sg4y_endgame2", "targetname");
    endagme_model2_trigger = GetEnt("sg4y_endgame_cable_pickup", "targetname");
    ladder1_trig = GetEnt("ladder1_trig", "targetname");
    ladder2_trig = GetEnt("ladder2_trig", "targetname");
    ladder3_trig = GetEnt("ladder3_trig", "targetname");
    ladder1 Hide();
    ladder2 Hide();
    ladder3 Hide();
    ladder1_trig Hide();
    ladder2_trig Hide();
    ladder3_trig Hide();

    level.step_3_pieces = 0;
    level waittill("mkd_3.1_start");

    thread step_3_1(ladder1, ladder1_trig);
    thread step_3_2(ladder2, ladder2_trig);
    thread step_3_3(ladder3, ladder3_trig);


    while(level.step_3_pieces != 3)
        wait 1;


    endagme_model2 Show();
    endagme_model2_trigger Show();
    endagme_model2 thread zm_powerups::powerup_wobble();
}



function step_3_1(ladder1, ladder1_trig)
{

    ladder1 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder1","targetname").origin);
    ladder1_trig Show();
    ladder1_trig SetCursorHint( "HINT_NOICON" );
    ladder1_trig setHintString( "Press and Hold ^3&&1^7 to Interact");

    // PART ONE - ELECTRIC CHERRY
    ladder1_trig waittill( "trigger", player );
    ladder1_trig Hide();
    ladder1 moveZ(150,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder1","targetname").origin);
    ladder1 Hide();
    level.step_3_pieces++;
}


function step_3_2(ladder2, ladder2_trig)
{
    // PART TWO - PHD
    ladder2 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder2","targetname").origin);
    ladder2_trig Show();
    ladder2_trig SetCursorHint( "HINT_NOICON" );
    ladder2_trig setHintString( "Press and Hold ^3&&1^7 to Interact");
    ladder2_trig waittill( "trigger", player );
    ladder2_trig Hide();
    ladder2 moveZ(150,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder2","targetname").origin);
    ladder2 Hide();
    level.step_3_pieces++;
}


function step_3_3(ladder3, ladder3_trig)
{
    // PART THREE - WIDOWS WINE
    ladder3 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder3","targetname").origin);
    ladder3_trig Show();
    ladder3_trig SetCursorHint( "HINT_NOICON" );
    ladder3_trig setHintString( "Press and Hold ^3&&1^7 to Interact");
    ladder3_trig waittill( "trigger", player );
    ladder3_trig Hide();
    ladder3 moveZ(70,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder3","targetname").origin);
    ladder3 Hide();
    level.step_3_pieces++;
}


MKD Joker:

function step_3()
{
    ladder1 = GetEnt("ladder1", "targetname");
    ladder2 = GetEnt("ladder2", "targetname");
    ladder3 = GetEnt("ladder3", "targetname");
    endagme_model2 = GetEnt("sg4y_endgame2", "targetname");
    endagme_model2_trigger = GetEnt("sg4y_endgame_cable_pickup", "targetname");
    ladder1_trig = GetEnt("ladder1_trig", "targetname");
    ladder2_trig = GetEnt("ladder2_trig", "targetname");
    ladder3_trig = GetEnt("ladder3_trig", "targetname");
    ladder1 Hide();
    ladder2 Hide();
    ladder3 Hide();
    ladder1_trig Hide();
    ladder2_trig Hide();
    ladder3_trig Hide();

    level.step_3_pieces = 0;
    level waittill("mkd_3.1_start");

    thread step_3_1(ladder1, ladder1_trig);
    thread step_3_2(ladder2, ladder2_trig);
    thread step_3_3(ladder3, ladder3_trig);


    while(level.step_3_pieces != 3)
        wait 1;


    endagme_model2 Show();
    endagme_model2_trigger Show();
    endagme_model2 thread zm_powerups::powerup_wobble();
}



function step_3_1(ladder1, ladder1_trig)
{

    ladder1 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder1","targetname").origin);
    ladder1_trig Show();
    ladder1_trig SetCursorHint( "HINT_NOICON" );
    ladder1_trig setHintString( "Press and Hold ^3&&1^7 to Interact");

    // PART ONE - ELECTRIC CHERRY
    ladder1_trig waittill( "trigger", player );
    ladder1_trig Hide();
    ladder1 moveZ(150,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder1","targetname").origin);
    ladder1 Hide();
    level.step_3_pieces++;
}


function step_3_2(ladder2, ladder2_trig)
{
    // PART TWO - PHD
    ladder2 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder2","targetname").origin);
    ladder2_trig Show();
    ladder2_trig SetCursorHint( "HINT_NOICON" );
    ladder2_trig setHintString( "Press and Hold ^3&&1^7 to Interact");
    ladder2_trig waittill( "trigger", player );
    ladder2_trig Hide();
    ladder2 moveZ(150,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder2","targetname").origin);
    ladder2 Hide();
    level.step_3_pieces++;
}


function step_3_3(ladder3, ladder3_trig)
{
    // PART THREE - WIDOWS WINE
    ladder3 Show();
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder3","targetname").origin);
    ladder3_trig Show();
    ladder3_trig SetCursorHint( "HINT_NOICON" );
    ladder3_trig setHintString( "Press and Hold ^3&&1^7 to Interact");
    ladder3_trig waittill( "trigger", player );
    ladder3_trig Hide();
    ladder3 moveZ(70,2);
    wait(3);
    playfx(level._effect["powerup_grabbed_solo"] ,GetEnt("ladder3","targetname").origin);
    ladder3 Hide();
    level.step_3_pieces++;
}

Thank you! works perfectly