UGX-Mods

Call of Duty 5: World at War => Downloadable Items for Mappers => Custom Maps, Mods & Tools => Scripts => Topic started by: death_reaper0 on May 17, 2016, 12:09:37 pm

Title: raygun and mark2 box fix
Post by: death_reaper0 on May 17, 2016, 12:09:37 pm
this is just a simple tweak to make sure that if you have the raygun you can not get the mark 2 from the box and visa versa (like in black ops 2).
this is assuming your mark 2 is named "ray_gun2" (name of harrybo21's version) if yours is named differently you will have to change it a bit to your rayguns name

this is a video of me having all guns but 2 (mark 2 being on of them) and as seen the box wont let me have it

note: this only affects the box, its still possible to get both though other ways if the mapper has something else that gives either gun

all you need to do is go into _zombiemode_weapons.gsc and find
Code Snippet
Plaintext
treasure_chest_ChooseWeightedRandomWeapon( player )

and directly under
Code Snippet
Plaintext
		if( !IsDefined( keys[i] ) )
{
continue;
}
place
Code Snippet
Plaintext
 
//filter out raygun duplicates
if (player HasWeapon( "ray_gun2" ) || player HasWeapon( "ray_gun2_upgraded" ))
{
if(keys[i] == "ray_gun")
continue;
}
if (player HasWeapon( "ray_gun" ) || player HasWeapon( "ray_gun_upgraded" ))
{
if(keys[i] == "ray_gun2")
continue;
}
and that's all you need to do (no need to credit if you don't want to, its nothing big after all)
Title: Re: raygun and mark2 box fix
Post by: Tim Smith on May 17, 2016, 12:26:25 pm
Great work man. Thx for sharing :). +1.
Title: Re: raygun and mark2 box fix
Post by: Scobalula on May 17, 2016, 03:15:10 pm
This awesome man! I can also adapt this to work with other guns such as if the player has Thunder Gun they can't have DG2, etc.
Title: Re: raygun and mark2 box fix
Post by: death_reaper0 on May 17, 2016, 04:12:06 pm
This awesome man! I can also adapt this to work with other guns such as if the player has Thunder Gun they can't have DG2, etc.
modify at will, you can add any gun to disallow any gun really, it would be great for maps with lots of WWs :)
Title: Re: raygun and mark2 box fix
Post by: Mr. Unp3rf3ct on July 10, 2016, 03:12:39 pm
This awesome man! I can also adapt this to work with other guns such as if the player has Thunder Gun they can't have DG2, etc.

Thats exactly what happens in my map. Thank god he released this! Because i will add the scavanger to my map, so this will look messy in the script if I also forbid the player having that and another wonder weapon, but the only thing that counts is IT WORKS :) :) :)
Title: Re: raygun and mark2 box fix
Post by: ColdShrimp2 on August 08, 2017, 09:09:34 pm
Late to the party, but how can I make this disable wallguns too(not rayguns)? I'm trying to make it so you can't buy wallguns or box guns when the "death machine" powerup is active
Title: Re: raygun and mark2 box fix
Post by: Fancygamer1738 on March 25, 2018, 07:43:43 pm
10/10. Amazing work! :nyan: