Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: xdferpc
I have a script to make a fire stick while I do it and pick it up
s changes my weapons involuntarily and in the end he takes all the money. How could I fix it ?
this is the script
#define PAP_WEAPON_KNUCKLE_CRACK "zombie_knuckle_crack"
in the function main()
thread build_staff_fire();
thread build();
function build_staff_fire()
{
staff_model = GetEnt("c_stafffire", "targetname");
staff_model hide();
buildTable = getEnt("c_table", "targetname");
buildTable SetHintString("Additional Parts Required");
buildTable SetCursorHint("HINT_NOICON");
level.allParts = 0;
level.finishedCraft = 3;
level thread pick1();
level thread pick2();
level thread pick3();
//level thread build();
}
function pick1()
{
pick_trig1 = getent("c_pick1", "targetname");
pick_trig1 SetHintString("Press and hold &&1 to pickup part");
pick_trig1 SetCursorHint("HINT_NOICON");
pick_model1 = getent("c_pickmodel1", "targetname");
while(1)
{
pick_trig1 waittill("trigger", player);
playfx(level._effect["powerup_grabbed"] ,GetEnt("c_pick1","targetname").origin);
level.allParts++;
//IPrintLnBold(level.allParts);
thread build();
break;
}
pick_trig1 delete();
pick_model1 delete();
}
function pick2()
{
pick_trig2 = getent("c_pick2", "targetname");
pick_trig2 SetHintString("Press and hold &&1 to pickup part");
pick_trig2 SetCursorHint("HINT_NOICON");
pick_model2 = getent("c_pickmodel2", "targetname");
while(1)
{
pick_trig2 waittill("trigger", player);
playfx(level._effect["powerup_grabbed"] ,GetEnt("c_pick2","targetname").origin);
level.allParts++;
//IPrintLnBold(level.allParts);
thread build();
break;
}
pick_trig2 delete();
pick_model2 delete();
}
function pick3()
{
pick_trig3 = getent("c_pick3", "targetname");
pick_trig3 SetHintString("Press and hold &&1 to pickup part");
pick_trig3 SetCursorHint("HINT_NOICON");
pick_model3 = getent("c_pickmodel3", "targetname");
while(1)
{
pick_trig3 waittill("trigger", player);
playfx(level._effect["powerup_grabbed"] ,GetEnt("c_pick3","targetname").origin);
level.allParts++;
//IPrintLnBold(level.allParts);
thread build();
break;
}
pick_trig3 delete();
pick_model3 delete();
}
function build()
{
while(1)
{
self waittill( level.allParts >= level.finishedCraft );
if ( level.allParts >= level.finishedCraft )
{
buildTable = GetEnt("c_table", "targetname");
buildTable SetHintString("Press and hold &&1 to craft");
buildTable SetCursorHint("HINT_NOICON");
buildTable waittill("trigger", player);
buildTable SetHintString("");
playfx(level._effect["powerup_grabbed"] ,GetEnt("c_table","targetname").origin);
player thread do_knuckle_crack();
wait(2.7);
buildTable SetHintString("Press and hold &&1 for Raygun");
buildTable SetCursorHint("HINT_NOICON");
raygun_model = GetEnt("c_stafffire", "targetname");
raygun_model show();
buildTable waittill("trigger", player);
weapon = getweapon("staff_fire");
player giveweapon(weapon);
player switchtoweapon(weapon);
raygun_model = GetEnt("c_stafffire", "targetname");
raygun_model hide();
buildTable delete();
}
break;
}
}
function private do_knuckle_crack()
{
self endon("disconnect");
self upgrade_knuckle_crack_begin();
self util::waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
self upgrade_knuckle_crack_end();
}
// Switch to the knuckles
//
function private upgrade_knuckle_crack_begin()
{
self zm_utility::increment_is_drinking();
self zm_utility::disable_player_move_states(false);
primaries = self GetWeaponsListPrimaries();
original_weapon = self GetCurrentWeapon();
weapon = GetWeapon( PAP_WEAPON_KNUCKLE_CRACK );
self GiveWeapon( weapon );
self SwitchToWeapon( weapon );
}
// Anim has ended, now switch back to something
//
function private upgrade_knuckle_crack_end()
{
self zm_utility::enable_player_move_states();
weapon = GetWeapon( PAP_WEAPON_KNUCKLE_CRACK );
// TODO: race condition?
if ( self laststand::player_is_in_laststand() || IS_TRUE( self.intermission ) )
{
self TakeWeapon(weapon);
return;
}
self zm_utility::decrement_is_drinking();
self TakeWeapon(weapon);
primaries = self GetWeaponsListPrimaries();
if( IS_DRINKING(self.is_drinking) )
{
return;
}
else
{
self zm_weapons::switch_back_primary_weapon();
}
}
ModmeBot:
Reply By: Harry Bo21
firstly - use code tags and proper code indentation. I cant read that for shiz
next - why make a buldable system when one is in the game and has been since bo2? just add to it, then you dont need to go through all this hassle
guide and template is on modme wiki