Modme Forums
Menu:

Rotative Powerup

Game Modding | Call of Duty: Black Ops 3 | Scripting


eDeK:

Hi, how can i do a "Rotative Powerup" like the "ShangriLa Monkey steal the powerup" in the powerups you get killing zombies?
Is with GSC and CSC?
Only CSC?


Spiki:

GSC:

function powerup()
{
drop_spot = some_struct.origin;

powerups = array("full_ammo", "carpenter", "free_perk");
time = 1;
while(1)
    {
    powerup_name = array::random(powerups);
    powerup = zm_powerups::specific_powerup_drop(powerup_name, drop_spot);
    wait(time);

    if(!isdefined(powerup))
        break;

    powerup Delete();
    }


}


ILikeCereal:

Hello Spiki, I suck at scripting and I seen this and thought it would be pretty cool. But my question is can you add a cost to the power-up? Any help would be awesome.


Spiki:

Hello Spiki, I suck at scripting and I seen this and thought it would be pretty cool. But my question is can you add a cost to the power-up? Any help would be awesome.

So you want to buy a powerup but it switches like shangrila?
I dont understand exactly what you want


ILikeCereal:

What I was thinking was having a power-up in different locations and have a trigger that you could buy them like a perk machine for power-up's


eDeK:

Thanks for reply Spiki.
With your script i have this error: Uninitialized local variable 'some_struct'
I changed your script with this:

function powerup()
{
    level waittill("powerup_dropped", powerup);
    drop_spot = powerup.origin;
    powerups = array("full_ammo", "double_points", "fast_feet", "nuke", "insta_kill", "free_perk");
    time = 1;
    while(1)
    {      
            powerup_name = array::random(powerups);
            powerup = zm_powerups::specific_powerup_drop(powerup_name, drop_spot - (0,0,40));
            wait(time);
            if(!isdefined(powerup))
                break;
            powerup Delete();
    }
}
Works fine the "rotative".
Problems:
The first powerup dropped by a zombie dont disappears and begin the "rotative powerups" in the middle .
The second powerup dropped by a zombie not do the "rotative powerups".


Spiki:

What I was thinking was having a power-up in different locations and have a trigger that you could buy them like a perk machine for power-up's

https://forum.modme.co/threads/help-map-crash-with-buyable-powerups-scprit.1937/#post-7389


Spiki:

Thanks for reply Spiki.
With your script i have this error: Uninitialized local variable 'some_struct'
I changed your script with this:
function powerup()
{
    level waittill("powerup_dropped", powerup);
    drop_spot = powerup.origin;
    powerups = array("full_ammo", "double_points", "fast_feet", "nuke", "insta_kill", "free_perk");
    time = 1;
    while(1)
    { 
            powerup_name = array::random(powerups);
            powerup = zm_powerups::specific_powerup_drop(powerup_name, drop_spot - (0,0,40));
            wait(time);
            if(!isdefined(powerup))
                break;
            powerup Delete();
    }
}
Works fine the "rotative".
Problems:
The first powerup dropped by a zombie dont disappears and begin the "rotative powerups" in the middle .
The second powerup dropped by a zombie not do the "rotative powerups".

Your script and now this one will only work for 1 powerup at a time

function powerup()
{

while(1)
    {
    level waittill("powerup_dropped", powerup);
    drop_spot = powerup.origin;
    powerups = array("full_ammo", "double_points", "fast_feet", "nuke", "insta_kill", "free_perk");
    time = 1;
    powerup Delete();
       while(1)
        { 
        powerup_name = array::random(powerups);
        powerup = zm_powerups::specific_powerup_drop(powerup_name, drop_spot + (0,0,-40));
        wait(time);
        if(!isdefined(powerup))
            break;
        powerup Delete();
        }
       }
}

A better solution:
function powerup()
{
 
while(1)
    {
    level waittill("powerup_dropped", powerup);
    drop_spot = powerup.origin + (0,0,-40);
    powerups = array("full_ammo", "double_points", "fast_feet", "nuke", "insta_kill", "free_perk");
    powerup Delete();
    thread rotate_powerup(drop_spot, powerups);
       }
}



function rotate_powerup(drop_spot, powerups)
{
time = 1;
while(1)
    {  
    powerup_name = array::random(powerups);
    powerup = zm_powerups::specific_powerup_drop(powerup_name, drop_spot);
    wait(time);
    if(!isdefined(powerup))
        break;
    powerup Delete();
       }
}
*untested*


eDeK:

Is CRAZY the powerup right now xD
Thanks i gonna still trying


ILikeCereal:

https://forum.modme.co/threads/help-map-crash-with-buyable-powerups-scprit.1937/#post-7389

It works perfect Spiki, Thank You for the help...