

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!pp_think()
{
flag_wait( "all_players_connected");
while(1)
{
if(self hasPerk("specialty_leadfoot"))
{
self SetClientDvars("g_gravity", "100");
}
wait .01;
}
treasure_chest_think()
{
cost = 950;
if( IsDefined( level.zombie_treasure_chest_cost ) )
{
cost = level.zombie_treasure_chest_cost;
}
else
{
cost = self.zombie_cost;
}
self set_hint_string( self, "default_treasure_chest_" + cost );
self setCursorHint( "HINT_NOICON" );
//self thread decide_hide_show_chest_hint( "move_imminent" );
// waittill someuses uses this
user = undefined;
while( 1 )
{
self waittill( "trigger", user );
if( user in_revive_trigger() )
{
wait( 0.1 );
continue;
}
// make sure the user is a player, and that they can afford it
if( is_player_valid( user ) && user.score >= cost )
{
user maps\_zombiemode_score::minus_to_player_score( cost );
break;
}
else if ( user.score < cost )
{
user thread maps\_zombiemode_perks::play_no_money_perk_dialog();
continue;
}
wait 0.05;
}
bonfire_powerup( drop_item, player_won )
{
iPrintLnBold("^7Bonfire Sale");
level.pap_cost = 1000;
wait ( 30 );
iPrintLnBold("^7Bonfire Sale Over");
level.pap_cost = 5000;
}
level.box_cost = 600
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
if( user in_revive_trigger() )
{
wait( 0.1 );
continue;
}
if( is_player_valid( user ) && user hasperk("specialty_PERK_SPECIALTY"))
{
cost = 700; //box cost with the perk
}
else
{
cost = 950;
}
//move it up
model moveto( model.origin +( 0, 0, floatHeight ), 3, 2, 0.9 );
//move it up
if(player hasperk("specialty_PERK_SPECIALTY"))
model moveto( model.origin +( 0, 0, floatHeight ), 1.5, 1, 0.45 );
else
model moveto( model.origin +( 0, 0, floatHeight ), 3, 2, 0.9 );
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Quick question: what should I put in the script, because it contains all of the functions for playing the song, waiting till power is on, etc. Can I just delete the if-then statement and it will run smoothly? Thanks again!!
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_hud_util;
init()
{
PrecacheItem( "zombie_perk_bottle_revive" );
PrecacheShader( "byz_pp_shader" );
pp_trigger = GetEnt( "zombie_vending_pp", "targetname" );
pp_trigger thread pp_trigger_think();
level thread maps\_zombiemode_perks::machine_watcher_factory("pp_on");
thread wait_a_little();
thread turn_pp_on();
}
wait_a_little()
{
flag_wait( "all_players_connected" );
players = get_players();
for(i=0;i<players.size;i++)
{
players[i] thread pp_think();
}
}
pp_think()
{
flag_wait( "all_players_connected");
while(1)
{
if(self hasPerk("specialty_leadfoot"))
{
self SetClientDvars("g_gravity", "100");
}
wait .01;
}
wait .01;
}
turn_pp_on()
{
machine = getent("vending_pp", "targetname");
level waittill("juggernog_on");
machine vibrate((0,-100,0), 0.3, 0.4, 3);
machine playsound("perks_power_on");
machine thread maps\_zombiemode_perks::perk_fx("doubletap_light");
level notify( "specialty_leadfoot_power_on" );
}
pp_trigger_think()
{
perk = "specialty_leadfoot";
self SetHintString( &"ZOMBIE_FLAMES_UNAVAILABLE" );
self SetCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookAt();
notify_name = perk + "_power_on";
level waittill("juggernog_on");
perk_hum = spawn("script_origin", self.origin);
perk_hum playloopsound("perks_machine_loop");
self thread check_player_has_perk(perk);
self SetHintString("^3Press & Hold &&1 To Buy Paranormal Potion ^2[Cost: 2000]");
for( ;; )
{
self waittill( "trigger", player );
index = maps\_zombiemode_weapons::get_player_index(player);
cost = 2000;
if (player maps\_laststand::player_is_in_laststand() )
{
continue;
}
if(player in_revive_trigger())
{
continue;
}
if( player isThrowingGrenade() )
{
wait( 0.1 );
continue;
}
if( player isSwitchingWeapons() )
{
wait(0.1);
continue;
}
if ( player HasPerk( perk ) )
{
self playsound("deny");
player thread maps\_zombiemode_perks::play_no_money_perk_dialog();
continue;
}
if ( player.score < cost )
{
self playsound("deny");
player thread maps\_zombiemode_perks::play_no_money_perk_dialog();
continue;
}
sound = "bottle_dispense3d";
player achievement_notify( "perk_used" );
playsoundatposition(sound, self.origin);
player maps\_zombiemode_score::minus_to_player_score( cost );
sting = "byz_pp_sting";
playsoundatposition(sting, self.origin);
gun = player perk_give_bottle_begin();
player.is_drinking = 1;
player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete", "whoswho_death" );
// restore player controls and movement
player perk_give_bottle_end( gun, "specialty_leadfoot" );
player.is_drinking = undefined;
// TODO: race condition?
if ( player maps\_laststand::player_is_in_laststand() )
{
continue;
}
player SetPerk("specialty_leadfoot");
player thread maps\_zombiemode_perks::perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);
player perk_hud_create( perk );
//stat tracking
player.stats["perks"]++;
//player iprintln( "Bought Perk: " + perk );
bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk",
player.playername, player.score, level.round_number, cost, perk, self.origin );
player thread perk_think( perk );
}
}
check_player_has_perk(perk)
{
dist = 128 * 128;
while(true)
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if(DistanceSquared( players[i].origin, self.origin ) < dist)
{
if(!players[i] hasperk(perk) && !(players[i] in_revive_trigger()) && (players[i].perk_hud.size < level.perk_limit))
{
if (IsDefined(level.script) && level.script == "nazi_zombie_theater")
self setinvisibletoplayer(players[i], false);
else
self setvisibletoplayer(players[i]);
}
else
{
self SetInvisibleToPlayer(players[i]);
}
}
}
wait(0.1);
}
}
perk_hud_create( perk )
{
if ( !IsDefined( self.perk_hud ) )
{
self.perk_hud = [];
}
shader = "byz_pp_shader";
hud = create_simple_hud( self );
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
hud.x = self.perk_hud.size * 30;
hud.y = hud.y - 70;
hud.alpha = 1;
hud SetShader( shader, 24, 24 );
self.perk_hud[ perk ] = hud;
}
perk_think()
{
self waittill_any( "fake_death", "death", "player_downed", "whoswho_death" );
self UnsetPerk("specialty_leadfoot");
self SetClientDvars("g_gravity", "800");
self maps\_zombiemode_perks::perk_hud_destroy("specialty_leadfoot");
}
perk_give_bottle_begin()
{
self DisableOffhandWeapons();
self DisableWeaponCycling();
self AllowLean( false );
self AllowAds( false );
self AllowSprint( false );
self AllowProne( false );
self AllowMelee( false );
wait( 0.05 );
if ( self GetStance() == "prone" )
{
self SetStance( "crouch" );
}
gun = self GetCurrentWeapon();
weapon = "";
self GiveWeapon("zombie_perk_bottle_revive");
self SwitchToWeapon("zombie_perk_bottle_revive");
return gun;
}
perk_give_bottle_end( gun, perk )
{
assert( gun != "zombie_perk_bottle_revive" );
assert( gun != "syrette" );
self EnableOffhandWeapons();
self EnableWeaponCycling();
self AllowLean( true );
self AllowAds( true );
self AllowSprint( true );
self AllowProne( true );
self AllowMelee( true );
weapon = "";
weapon = "zombie_perk_bottle_revive";
// TODO: race condition?
if ( self maps\_laststand::player_is_in_laststand() )
{
self TakeWeapon(weapon);
return;
}
if ( gun != "none" && gun != "mine_bouncing_betty" )
{
self SwitchToWeapon( gun );
}
else
{
// try to switch to first primary weapon
primaryWeapons = self GetWeaponsListPrimaries();
if( IsDefined( primaryWeapons ) && primaryWeapons.size > 0 )
{
self SwitchToWeapon( primaryWeapons[0] );
}
}
self TakeWeapon(weapon);
}
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_hud_util;
init()
{
//PrecacheItem( "zombie_perk_bottle_revive" ); //F3AR - SHOULDNT BE NEEDED, UNLESS YOUR MAP HAS NO QUICK REVIVE
PrecacheShader( "byz_pp_shader" ); //F3AR - THIS NEEDS TO BE THE NAME OF THE ICON TO APPEAR ON THE HUD
pp_trigger = GetEnt( "zombie_vending_pp", "targetname" ); //F3AR - THE "TARGETNAME" OF YOUR PERKS TRIGGER NEEDS TO MATCH THIS
pp_trigger thread pp_trigger_think();
level thread maps\_zombiemode_perks::machine_watcher_factory("pp_on");
thread turn_pp_on();
}
turn_pp_on()
{
machine = getent("vending_pp", "targetname");
level waittill("juggernog_on");
machine vibrate((0,-100,0), 0.3, 0.4, 3);
machine playsound("perks_power_on");
machine thread maps\_zombiemode_perks::perk_fx("doubletap_light");
level notify( "specialty_leadfoot_power_on" );
}
pp_trigger_think()
{
perk = self.specialty;
self SetHintString( &"ZOMBIE_FLAMES_UNAVAILABLE" );
self SetCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookAt();
notify_name = perk + "_power_on";
level waittill("juggernog_on");
perk_hum = spawn("script_origin", self.origin);
perk_hum playloopsound("perks_machine_loop");
self thread check_player_has_perk(perk);
self SetHintString("^3Press & Hold &&1 To Buy Paranormal Potion ^2[Cost: 2000]"); //F3AR - THIS IS WHAT THE PERK WILL SAY WHEN NEXT TO IT, &&1 IS AUTOMATICLY CHANGED TO THE PLAYERS USE BUTTON
//F3AR - YOU SHOULD ONLY NEED TO CHANGE THE NAME AND COST
for( ;; )
{
self waittill( "trigger", player );
index = maps\_zombiemode_weapons::get_player_index(player);
cost = 2000; //F3AR - THIS IS THE PRICE OF THE PERK, MAKE SURE IT MATCHES THE PRICE OF THE TRIGGER
if (player maps\_laststand::player_is_in_laststand() || player in_revive_trigger() || player HasPerk( perk ) )
continue;
if( player isThrowingGrenade() || player isSwitchingWeapons() )
{
wait( 0.1 );
continue;
}
if ( player.score < cost )
{
self playsound("deny");
player thread maps\_zombiemode_perks::play_no_money_perk_dialog();
continue;
}
sound = "bottle_dispense3d";
player achievement_notify( "perk_used" );
playsoundatposition(sound, self.origin);
player maps\_zombiemode_score::minus_to_player_score( cost );
gun = player perk_give_bottle_begin();
player.is_drinking = 1;
player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete", "whoswho_death" );
// restore player controls and movement
player perk_give_bottle_end( gun, "specialty_leadfoot" );
player.is_drinking = undefined;
// TODO: race condition?
if ( player maps\_laststand::player_is_in_laststand() )
continue;
player SetPerk(perk);
player thread maps\_zombiemode_perks::perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);
player perk_hud_create( perk );
//stat tracking
player.stats["perks"]++;
bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk",
player.playername, player.score, level.round_number, cost, perk, self.origin );
player thread perk_think( perk );
}
}
check_player_has_perk(perk)
{
dist = 128 * 128;
while(true)
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if(DistanceSquared( players[i].origin, self.origin ) < dist)
{
if(!players[i] hasperk(perk) && !(players[i] in_revive_trigger()) && (players[i].perk_hud.size < level.perk_limit))
{
if (IsDefined(level.script) && level.script == "nazi_zombie_theater")
self setinvisibletoplayer(players[i], false);
else
self setvisibletoplayer(players[i]);
}
else
self SetInvisibleToPlayer(players[i]);
}
}
wait(0.1);
}
}
perk_hud_create( perk )
{
if ( !IsDefined( self.perk_hud ) )
self.perk_hud = [];
shader = "byz_pp_shader"; //F3AR - THIS SHOULD BE THE IMAGE TO ADD TO THE HUD FROM THE TOP OF THE SCRIPT
hud = create_simple_hud( self );
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
hud.x = self.perk_hud.size * 30;
hud.y = hud.y - 70;
hud.alpha = 1;
hud SetShader( shader, 24, 24 );
self.perk_hud[ perk ] = hud;
}
perk_think(perk)
{
self waittill_any( "fake_death", "death", "player_downed", "whoswho_death" );
self UnsetPerk(perk);
self maps\_zombiemode_perks::perk_hud_destroy(perk);
}
perk_give_bottle_begin()
{
self DisableOffhandWeapons();
self DisableWeaponCycling();
self AllowLean( false );
self AllowAds( false );
self AllowSprint( false );
self AllowProne( false );
self AllowMelee( false );
wait( 0.05 );
if ( self GetStance() == "prone" )
self SetStance( "crouch" );
gun = self GetCurrentWeapon();
weapon = "";
self GiveWeapon("zombie_perk_bottle_revive");
self SwitchToWeapon("zombie_perk_bottle_revive");
return gun;
}
perk_give_bottle_end( gun, perk )
{
assert( gun != "zombie_perk_bottle_revive" );
assert( gun != "syrette" );
self EnableOffhandWeapons();
self EnableWeaponCycling();
self AllowLean( true );
self AllowAds( true );
self AllowSprint( true );
self AllowProne( true );
self AllowMelee( true );
weapon = "";
weapon = "zombie_perk_bottle_revive";
// TODO: race condition?
if ( self maps\_laststand::player_is_in_laststand() )
{
self TakeWeapon(weapon);
return;
}
if ( gun != "none" && gun != "mine_bouncing_betty" )
self SwitchToWeapon( gun );
else
{
// try to switch to first primary weapon
primaryWeapons = self GetWeaponsListPrimaries();
if( IsDefined( primaryWeapons ) && primaryWeapons.size > 0 )
self SwitchToWeapon( primaryWeapons[0] );
}
self TakeWeapon(weapon);
}
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Thank you so much!
Here's what I'm thinking:
Change the stuff in your first reply,
Use the script you placed last and integrate it as scriptz did,
Change the hintstring as you said,
And use the same KVP's, of course changing the specialty_ and pp to boxbooze.
If that's it, I should have it put together very soon. I plan on releasing it on UGX.
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Yes, I understand. I watched one of zomb1e-kllr's videos on youtube, and he showed a picture of the WaW multiplayer perks or specialty's as he made his own custom perk. I then looked at Harry's perk's specialties, and what Paranormal Potion had. With those, there are about ten left to choose from. If I wanted PP, Harry's perk's, and mine, they need to all be different, correct?
specialty_quickrevive
specialty_bulletaccuracy
specialty_fireproof
specialty_longersprint
specialty_pistoldeath
specialty_shades
specialty_bulletdamage
specialty_explosivedamage
specialty_altmelee
specialty_grenadepulldeath
specialty_quieter
specialty_specialgrenade
specialty_armorvest
specialty_bulletpenetration
specialty_extraammo
specialty_gas_mask
specialty_holdbreath
specialty_ordinance
specialty_twoprimaries
specialty_boost
specialty_detectexplosive
specialty_fastreload
specialty_gpsjammer
specialty_leadfoot
specialty_pin_back
specialty_rof
specialty_exposeenemy
specialty_reconnaissance