Modme Forums
Menu:

Need help with adding onscreen message to EE script

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


nightmare0161:

Hello there i need help with ice grenades script when a trigger is shot so that it displays on screen message when EE is completed and and how many targets you have shot.
Example-1/50 targets ,all targets destroyed collect your reward"
https://pastebin.com/iru9hwX8


Magicman:

main function:
thread eeDoor();

//PUT this section at the very end of your script
function eeDoor()
{
level.itemsRequired = 3; //change to number of shootable objects
level.itemsCollected = 0;
level thread item1();
level thread item2();
level thread item3();
//Add additional items here
}

function item1()
{
trig1 = GetEnt("ee_trig1", "targetname");
obj1 = GetEnt("ee_obj1", "targetname");
trig1 SetHintString("");
trig1 SetCursorHint("HINT_NOICON");
while(1)
{
trig1 waittill("trigger", player);
level.itemsCollected++;
thread eeCheckDone(player);
break;
}
trig1 Delete();
obj1 Delete();
IPrintLnBold(level.itemsCollected+"/3");

}

function item2()
{
trig2 = GetEnt("ee_trig2", "targetname");
obj2 = GetEnt("ee_obj2", "targetname");
trig2 SetHintString("");
trig2 SetCursorHint("HINT_NOICON");
while(1)
{
trig2 waittill("trigger", player);
level.itemsCollected++;
thread eeCheckDone(player);
break;
}
trig2 Delete();
obj2 Delete();
IPrintLnBold(level.itemsCollected+"/3");
}

function item3()
{
trig3 = GetEnt("ee_trig3", "targetname");
obj3 = GetEnt("ee_obj3", "targetname");
trig3 SetHintString("");
trig3 SetCursorHint("HINT_NOICON");
while(1)
{
trig3 waittill("trigger", player);
level.itemsCollected++;
thread eeCheckDone(player);
break;
}
trig3 Delete();
obj3 Delete();
IPrintLnBold(level.itemsCollected+"/3");
}

function eeCheckDone(player)
{
while(1)
{
self waittill(level.shootablesCollected >= level.itemsRequired);
if(level.itemsCollected == level.itemsRequired)
{
//self playlocalsound( level.zmb_laugh_alias ); Not working atm
objDoor = GetEnt("ee_door", "targetname");
objDoor Delete();
objDoor = GetEnt("ee_door2", "targetname");
objDoor Delete();
objClip = GetEnt("ee_clip", "targetname");
objClip Delete();
IPrintLnBold("ALL TRIGGERS SHOT, COLLECT YOUR REWARD");
}
break;
}
}


nightmare0161:

thanks pal