So I have a new grenade type in my map but when you buy them you get 4 of the new and you'll still have the normal standard grenades. When the next round starts, you'll get two standard and none of the alternate. You'll only get it when you buy them off the wall again.
Also aside from this, when I get it from the box it replaces the gun that you have out :(
If someone could help me that would be fantastic!
By the way, just so if there was a coded reply, my standard grenades are "stielhandgranate" and we'll call the new ones "stielhandgranate2"
If you buy them on the wall, as a normal wall weapon, you need to include your weapon inside the if where it takes the player's weapon (_zombiemode_weapons, weapon_give( weapon, is_upgrade ) ):
Then you have to take the player's grenades, checking if the player has them and that you're giving the new grenades to take his normal grenades. If they appear in the box the code is very similar but in treasure_chest_give_weapon( weapon_string ) and if you're not using the original script for this, you'll have to find where the script for buying wall weapons is. And for the round part, with the name you gave to grenades is really simple. Go to award_grenades_for_survivors() and you have to add this inside the first if statement:
If you buy them on the wall, as a normal wall weapon, you need to include your weapon inside the if where it takes the player's weapon (_zombiemode_weapons, weapon_give( weapon, is_upgrade ) ):
Then you have to take the player's grenades, checking if the player has them and that you're giving the new grenades to take his normal grenades. If they appear in the box the code is very similar but in treasure_chest_give_weapon( weapon_string ) and if you're not using the original script for this, you'll have to find where the script for buying wall weapons is. And for the round part, with the name you gave to grenades is really simple. Go to award_grenades_for_survivors() and you have to add this inside the first if statement:
//if is not an upgraded perk purchase if( !IsDefined( is_upgrade ) ) { is_upgrade = false; }
// This should never be true for the first time. if( primaryWeapons.size >= 2 ) // he has two weapons { current_weapon = self getCurrentWeapon(); // get his current weapon
if( weapon == "zombie_cymbal_monkey" ) { // PI_CHANGE_BEGIN // JMA 051409 sanity check to see if we have the weapon before we remove it has_weapon = self HasWeapon( "molotov" ); if( isDefined(has_weapon) && has_weapon ) { self TakeWeapon( "molotov" ); }
The weapon var should be passed on from the function that called it. Did you put it in the correct function, and not in the function for the box? ( treasure_cheast_give_weapon )
//if is not an upgraded perk purchase if( !IsDefined( is_upgrade ) ) { is_upgrade = false; }
// This should never be true for the first time. if( primaryWeapons.size >= 2 ) // he has two weapons { current_weapon = self getCurrentWeapon(); // get his current weapon
if( weapon == "zombie_cymbal_monkey" ) { // PI_CHANGE_BEGIN // JMA 051409 sanity check to see if we have the weapon before we remove it has_weapon = self HasWeapon( "molotov" ); if( isDefined(has_weapon) && has_weapon ) { self TakeWeapon( "molotov" ); }
The weapon var should be passed on from the function that called it. Did you put it in the correct function, and not in the function for the box? ( treasure_cheast_give_weapon )
Right, I didnt check the actual script, so I went with what was shown in his comment Yeah, check that the function name is weapon_give( weapon, is_upgrade )
I dont believe so Where in the function would it go?
You must have put it in other function because weapon is initialized since it's an argument of the function. The function is the one Blunt copied in the Hidden text. You only have to find this line inside that function:
You must have put it in other function because weapon is initialized since it's an argument of the function. The function is the one Blunt copied in the Hidden text. You only have to find this line inside that function: