Posts
136
Respect
67Add +1
Forum Rank
Pack-a-Puncher
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!while(1){
kit_trig waittill("trigger", player);
sawsound = spawn("script_origin", kit_trig.origin);
sawsound playsound ("buildable_loop");
kit_trig SetHintString("");
player thread crack_knuckles();
wait 7;
player notify("buildable_completed");
sawsound playsound("buildable_completed");
playfx(level._effect["powerup_grabbed"], kit_model.origin);
kit_model show();
break;
}kit_trig waittill("trigger", player);
sawsound = spawn("script_origin", kit_trig.origin);
sawsound playsound ("buildable_loop");
kit_trig SetHintString("");
player thread crack_knuckles();
while(PLAYER IS ON/HOLDING TRIGGER){
//Update progress bar, count, etc.
}
player notify("buildable_completed");
sawsound playsound("buildable_completed");
playfx(level._effect["powerup_grabbed"], kit_model.origin);
kit_model show();
break;
![]() | |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
![]() | Has released one or more maps to the UGX-Mods community. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
ProgressBars(timer, knuckle, deleteit){
/* timer = optional, int or float for time to finish progress bar
knuckle = optional, boolean to have knuckle crack during or not
deleteit = optional, delete this trigger when done, boolean, default deletes it
Requires: knuckle_crack() and #include maps\_hud_util;
Displays a progress bar while player is holding use button until time is up, notifies
stop_building when progress bar is done, used for knuckle crack timer
Calls:
trig ProgressBars();
trig ProgressBars(timer);
trig ProgressBars(timer, knuckle);
trig ProgressBars(timer, knuckle, deleteit);
*/
if(!IsDefined( self )) return false;
if(!isDefined(timer)) timer=3;
constTime = timer;
player = undefined;
while(timer>0){
self waittill("trigger", player);
if(!is_player_valid( player )) return false;
if(isDefined(knuckle) && knuckle){
player thread knuckle_crack();
while(player GetCurrentWeapon() != "zombie_knuckle_crack") wait(.1);
}
player.PBar = player CreatePrimaryProgressBar();
player.PBar.color = ( .5, 1, 1 );
player.PBar UpdateBar( 0.01, 1/constTime );
while(player UseButtonPressed() && distance(player.origin, self.origin)<100 && player isOnGround() && !player maps\_laststand::player_is_in_laststand() && timer>0){
wait(.1);
timer = timer-.1;
}
player notify("stopped_building");
player.PBar destroyElem();
player.PBar = undefined;
}
if(!IsDefined( deleteit ) || deleteit) self delete();
}
knuckle_crack(){// self is player
/* no vars
Requires: AllowMoving(cond) and zombie_knuckle_crack
Cracks players knuckles, checks if has deathmachine before giving back last weapon
Calls:
player thread knuckle_crack();
*/
if(is_player_valid( self )) return;
self DisableOffhandWeapons();
self AllowMoving(false);
if( self GetStance() == "prone" ) self SetStance("crouch");
gun = self GetCurrentWeapon();
self GiveWeapon( "zombie_knuckle_crack" );
self SwitchToWeapon( "zombie_knuckle_crack" );
self waittill_any( "fake_death", "death", "player_downed", "stopped_building", "weapon_change_complete");
self EnableOffhandWeapons();
if(self GetCurrentWeapon()=="zombie_knuckle_crack" && IsSubStr( gun,"deathmachine" ) && (self !HasWeapon( "deathmachine" ) && self !HasWeapon( "deathmachine_upgraded" ))) self SwitchToWeapon( self GetWeaponsListPrimaries()[0] );
if(self GetCurrentWeapon()=="zombie_knuckle_crack" && is_player_valid(self)) self SwitchToWeapon( gun );
self TakeWeapon( "zombie_knuckle_crack" );
self AllowMoving(true);
}
AllowMoving(cond){//true to allow moving, false to not allow moving
/* cond = true or false, true will allow moving, false will prevent it
*/
self AllowLean(cond);
self AllowAds(cond);
self AllowSprint(cond);
self AllowProne(cond);
self AllowMelee(cond);
}
For something like this you would use a progress bar probably. Here are some of my helper functions that you may be able to take something from to work for what you want. Code SnippetPlaintextProgressBars(timer, knuckle, deleteit){
/* timer = optional, int or float for time to finish progress bar
knuckle = optional, boolean to have knuckle crack during or not
deleteit = optional, delete this trigger when done, boolean, default deletes it
Requires: knuckle_crack() and #include maps\_hud_util;
Displays a progress bar while player is holding use button until time is up, notifies
stop_building when progress bar is done, used for knuckle crack timer
Calls:
trig ProgressBars();
trig ProgressBars(timer);
trig ProgressBars(timer, knuckle);
trig ProgressBars(timer, knuckle, deleteit);
*/
if(!IsDefined( self )) return false;
if(!isDefined(timer)) timer=3;
constTime = timer;
player = undefined;
while(timer>0){
self waittill("trigger", player);
if(!is_player_valid( player )) return false;
if(isDefined(knuckle) && knuckle){
player thread knuckle_crack();
while(player GetCurrentWeapon() != "zombie_knuckle_crack") wait(.1);
}
player.PBar = player CreatePrimaryProgressBar();
player.PBar.color = ( .5, 1, 1 );
player.PBar UpdateBar( 0.01, 1/constTime );
while(player UseButtonPressed() && distance(player.origin, self.origin)<100 && player isOnGround() && !player maps\_laststand::player_is_in_laststand() && timer>0){
wait(.1);
timer = timer-.1;
}
player notify("stopped_building");
player.PBar destroyElem();
player.PBar = undefined;
}
if(!IsDefined( deleteit ) || deleteit) self delete();
}
knuckle_crack(){// self is player
/* no vars
Requires: AllowMoving(cond) and zombie_knuckle_crack
Cracks players knuckles, checks if has deathmachine before giving back last weapon
Calls:
player thread knuckle_crack();
*/
if(is_player_valid( self )) return;
self DisableOffhandWeapons();
self AllowMoving(false);
if( self GetStance() == "prone" ) self SetStance("crouch");
gun = self GetCurrentWeapon();
self GiveWeapon( "zombie_knuckle_crack" );
self SwitchToWeapon( "zombie_knuckle_crack" );
self waittill_any( "fake_death", "death", "player_downed", "stopped_building", "weapon_change_complete");
self EnableOffhandWeapons();
if(self GetCurrentWeapon()=="zombie_knuckle_crack" && IsSubStr( gun,"deathmachine" ) && (self !HasWeapon( "deathmachine" ) && self !HasWeapon( "deathmachine_upgraded" ))) self SwitchToWeapon( self GetWeaponsListPrimaries()[0] );
if(self GetCurrentWeapon()=="zombie_knuckle_crack" && is_player_valid(self)) self SwitchToWeapon( gun );
self TakeWeapon( "zombie_knuckle_crack" );
self AllowMoving(true);
}
AllowMoving(cond){//true to allow moving, false to not allow moving
/* cond = true or false, true will allow moving, false will prevent it
*/
self AllowLean(cond);
self AllowAds(cond);
self AllowSprint(cond);
self AllowProne(cond);
self AllowMelee(cond);
}