UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: gympie6 on August 08, 2018, 09:48:40 pm

Title: Boss zombie run/sprint fix!
Post by: gympie6 on August 08, 2018, 09:48:40 pm
If a zombie is shot near another zombie there is a chance he gets mad.
When it happens he goes running/sprinting.

To fix this issue there is one line of code needed to fix that.

change this:
Code Snippet
Plaintext
if( level.round_number > 3 )
    {
        zombies = getaiarray( "axis" );
        while( zombies.size > 0 )
        {
            if( zombies.size == 1 && zombies[0].has_legs == true )
            {
                var = randomintrange(1, 4);
                zombies[0] set_run_anim( "sprint" + var );                      
                zombies[0].run_combatanim = level.scr_anim[zombies[0].animname]["sprint" + var];
            }
            wait(0.5);
            zombies = getaiarray("axis");
        }

    }
in to this:
Code Snippet
Plaintext
if( level.round_number > 3 )
    {
        zombies = getaiarray( "axis" );
        while( zombies.size > 0 )
        {
            if( zombies.size == 1 && zombies[0].has_legs == true && zombies[0].boss == false)
            {
                var = randomintrange(1, 4);
                zombies[0] set_run_anim( "sprint" + var );                      
                zombies[0].run_combatanim = level.scr_anim[zombies[0].animname]["sprint" + var];
            }
            wait(0.5);
            zombies = getaiarray("axis");
        }

    }
In the boss script when the boss is spawned at this somewhere:
Code Snippet
Plaintext
self.boss = true;