My Give All Perks Script Isn't Working
-
Thanks for the fix it worked
Now my perk icons won't show once I've given the perks. Is there anyway to fix that? -
Doob
With give_perk("specialty_armorvest"); will give just the perk ability. You can use this function to give the perk ability and show the icon. This funcion will show also the drink animations when you give the perk.doGivePerk(perk) { self endon("disconnect"); self endon("death"); level endon("game_ended"); self endon("perk_abort_drinking"); if (!(self hasperk(perk) || (self maps/mp/zombies/_zm_perks::has_perk_paused(perk)))) { gun = self maps/mp/zombies/_zm_perks::perk_give_bottle_begin(perk); evt = self waittill_any_return("fake_death", "death", "player_downed", "weapon_change_complete"); if (evt == "weapon_change_complete") self thread maps/mp/zombies/_zm_perks::wait_give_perk(perk, 1); self maps/mp/zombies/_zm_perks::perk_give_bottle_end(gun, perk); if (self maps/mp/zombies/_zm_laststand::player_is_in_laststand() || isDefined(self.intermission) && self.intermission) return; self notify("burp"); } }
-
Doob I figured I'd make a simple script that would work for all maps giving all perks.
It uses some of Treyarch's code from buried to work but slightly modified:#include maps/mp/zombies/_zm_utility; #include maps/mp/_utility; #include common_scripts/utility; #include maps/mp/zombies/_zm_perks; init() { level thread on_player_connect(); } on_player_connect() { level endon( "end_game" ); while ( true ) { level waittill( "connected", player ); player thread on_player_spawned(); player thread sq_give_player_all_perks(); } } on_player_spawned() { level endon( "end_game" ); self endon( "disconnect" ); while ( true ) { self waittill( "spawned_player" ); } } sq_give_player_all_perks() { flag_wait( "initial_blackscreen_passed" ); if ( level.script != "zm_tomb" ) { machines = getentarray( "zombie_vending", "targetname" ); perks = []; i = 0; while ( i < machines.size ) { if ( machines[ i ].script_noteworthy == "specialty_weapupgrade" ) { i++; continue; } perks[ perks.size ] = machines[ i ].script_noteworthy; i++; } } else { perks = level._random_perk_machine_perk_list; } foreach ( perk in perks ) { if ( isDefined( self.perk_purchased ) && self.perk_purchased == perk ) { } else { if ( self hasperk( perk ) || self maps/mp/zombies/_zm_perks::has_perk_paused( perk ) ) { } else { self maps/mp/zombies/_zm_perks::give_perk( perk, 0 ); wait 0.25; } } } if ( getDvarInt( "players_keep_perks_permanently" ) == 1 ) { if ( !is_true( self._retain_perks ) ) { self thread watch_for_respawn(); self._retain_perks = 1; } } } watch_for_respawn() { level endon( "end_game" ); self endon( "disconnect" ); while ( true ) { self waittill_either( "spawned_player", "player_revived" ); wait_network_frame(); self thread sq_give_player_all_perks(); self setmaxhealth( level.zombie_vars[ "zombie_perk_juggernaut_health" ] ); } }
You can set this dvar:
players_keep_perks_permanently
to 1 in your server config for players to never lose perks even if they down, or bleedout. If you play solo with this mod with the dvar set you'll also have infinite quick revives. -
JezuzLizard Wow, big thanks dude! Fantastic script : )
I do have two questions though, by server config for the perma perk value do you mean like in the dedicated_zm.cfg? Also are there any work arounds for mob of the dead? You do get the perks at the start but since you down at the beginning you loose them. -
Doob Its difficult to make it work on mob since mob has its own system with how perks work when you down. What you could do is make the script give the perks every time a player respawns or is revived.
-
how to give perk on zm_tomb ? i've tried many but dont work.
-
This post is deleted!
-
This post is deleted!
-
Sorex lo estoy probando y seme congela el juego cuando me da las bebidas. alguna solución?
-
JezuzLizard Im just now seeing this, pretty cool especially
players_keep_perks_permanently
couldn't you just use this to give all perks?for( i = 0; i < level.perks.size; i++ ) { self give_perk( level.perks[ i ] ); }