Posts
513
Respect
49Add +1
Forum Rank
Zombie Enslaver
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
self waittill("trigger", player);
self.current_weapon = player GetCurrentWeapon();
player giveweapon("zombie_thompson"); // change to your weapon name
player SwitchToWeapon("zombie_thompson"); // change to your weapon name
old_gun = player getcurrentweapon();
trigger waittill("trigger", player);
player takeweapon( old_gun );
player giveweapon( "WEAPONNAME" );
player switchtoweapon( "WEAPONNAME" );![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
old_gun = player getcurrentweapon();
trigger waittill("trigger", player);
player takeweapon( old_gun );
player giveweapon( "WEAPONNAME" );
player switchtoweapon( "WEAPONNAME" );![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() UGX V.I.P. | |
![]() | Has shown excellence and experience in the area of custom mapping in the UGX-Mods community. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
trigger waittill("trigger", player);
// Begin getting all the player's info after the trigger, since that is what defines the player
oldWeapon = player GetCurrentWeapon();
weapons = player GetWeaponsListPrimaries();
// Use a check to see if the game should take away the player's current weapon
// since the player shouldn't have their weapon removed if they only have one
if( weapons.size >= 2 )
player TakeWeapon( oldWeapon );
player GiveWeapon( "WEAPONNAME" );
player SwitchToWeapon( "WEAPONNAME" );Also you shouldn't try getting the player's weapon before the trigger is triggered, since well... the player isn't defined yet.
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
if your using my perks, giveweapon() will break mule kick
need to use the "harrybo21_give_gun( gunname )" from my utility script
it will "remove" the old gun automatically, and will do the "switchto" or you too
![]() | Has released one or more maps to the UGX-Mods community. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
i know this is a old post but are you saying if some1 comes along and decides to use a tutorial that has example: giveweapon(); in script. then its not going to break mule kick?
If i think alot of tuts have giveweapon() in there scripts.
im just wondering ?
GiveWeaponOrAmmo(gun){//gave = player GiveWeaponOrAmmo(nameofguntogive);
currentGun = self GetCurrentWeapon();
if(!isDefined(gun) || !isDefined(currentGun) || gun == "none" || WeaponClass(gun) == "grenade" || currentGun == "none" || WeaponClass(currentGun) == "grenade" ) return "none";
if(self HasWeapon(gun)){
if(WeaponClass(gun) == "gas" || weaponStartAmmo(gun) <= self getWeaponAmmoStock(gun)) return "none";
self GiveStartAmmo(gun);
return "ammo";
}
weapons = self GetWeaponsListPrimaries();
maxguns = 2;
if(self HasPerk("specialty_extraammo")) maxguns = 3;
if(weapons.size >= maxguns) self TakeWeapon(currentGun);
self GiveWeapon(gun);
self SwitchToWeapon(gun);
self GiveStartAmmo(gun);
return "gun";
}
GiveWeaponOrAmmo(gun){//gave = player GiveWeaponOrAmmo(nameofguntogive);
currentGun = self GetCurrentWeapon();
if(!is_player_valid(self) || !isDefined(level.zombie_include_weapons[gun]) || !isDefined(gun) || !isDefined(currentGun) || gun == "none" || WeaponClass(gun) == "grenade" || currentGun == "none" || WeaponClass(currentGun) == "grenade" ) return "none";
if(self HasWeapon(gun) && self.score+5 >= level.zombie_include_weapons[gun].ammo_cost){
if(WeaponClass(gun) == "gas" || weaponStartAmmo(gun) <= self getWeaponAmmoStock(gun)) return "none";
self GiveStartAmmo(gun);
if(gun != currentGun) self SwitchToWeapon(gun);
self maps\_zombiemode_score::minus_to_player_score( level.zombie_include_weapons[gun].ammo_cost );
self playLocalSound("cha_ching");
return "ammo";
}else if(self.score+5 >= level.zombie_include_weapons[gun].cost){
weapons = self GetWeaponsListPrimaries();
maxguns = 2;
if(self HasPerk("specialty_extraammo")) maxguns = 3;
if(weapons.size >= maxguns) self TakeWeapon(currentGun);
self GiveWeapon(gun);
self SwitchToWeapon(gun);
self GiveStartAmmo(gun);
self maps\_zombiemode_score::minus_to_player_score( level.zombie_include_weapons[gun].cost );
self playLocalSound("cha_ching");
return "gun";
}
self playLocalSound("no_cha_ching");
return "none";
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |