This quick tutorial will show you how you can add a wall buy in your map that will spawn a random power up. The trigger can be placed on any wall or surfase and the location of the power up can be customised to suit your needs.
Original Credit : Click Here
Open up your mapname.gsc file that can be located by right clicking your map in the mod tools launcher and selecting “show zone folder”.
From here you can then navigate back to the maps base folder.
Now the mapname.gsc will be located in the “scripts > zm” folder.
Open up your mapname.gsc in your favourite text editor (I use notepad++) and at the top of the file add the following line.
Next you will need to add the following line at the bottom of the main function
Finally add this section of code to the very bottom of the file and you are done with all the code edits.
level.buyable_powerup_cost = 100; // Cost for powerup
level.buyable_powerup_cooldown = 20; // Cooldown in seconds for buyable trigger
buyable_powerup_trig = GetEnt("buyable_powerup_trig", "targetname");
buyable_powerup_trig SetHintString("Press and hold &&1 to spawn Powerup [Cost: " + level.buyable_powerup_cost + "]");
buyable_powerup_spawn = struct::get( "powerup_spawn", "targetname" );
buyable_powerup_trig waittill("trigger", player);
if(player.score >= level.buyable_powerup_cost)
If you want a specific powerup, then uncomment the buyable_powerup_spawn below and delete or comment out the one above it.
Available Powerups: double_points, free_perk, full_ammo, nuke, fire_sale, carpenter, insta_kill, shield_charge, bonfire_sale,
buyable_powerup_spawn thread zm_powerups::special_powerup_drop(buyable_powerup_spawn.origin);
//buyable_powerup_spawn thread zm_powerups::specific_powerup_drop("full_ammo", buyable_powerup_spawn.origin);
Now for the last stage of this tutorial you will need to load up your map into radiant. Place a “trigger > use” over the area you want the player to purchase the power up. Pres “n” to bring up the entity info and set targetname to buyable_powerup_trig.
After that you need to place a “script > struct” in the place you would like to have the power up spawn. Again while in the entity properties you will need to set the targetname to “powerup_spawn”.