
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
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. |
magic_ray_powerup( drop_item, player_won )
{
if(level.player hasWeapon("ray_gun"))
{
curgun = self getCurrentWeapon();
//self giveWeapon("ray_gun");
setSavedDvar("player_sustainAmmo", "1");
//switch gun
self switchToWeapon("ray_gun");
self DisableWeaponCycling();
iPrintLn ("Ray gun given");
wait( 20 );
setSavedDvar("player_sustainAmmo", "0");
self EnableWeaponCycling();
self switchToWeapon( curgun );
}
else
{
curgun = self getCurrentWeapon();
self giveWeapon("ray_gun");
setSavedDvar("player_sustainAmmo", "1");
//switch gun
self switchToWeapon("ray_gun");
self DisableWeaponCycling();
iPrintLn ("Ray gun given");
wait( 20 );
setSavedDvar("player_sustainAmmo", "0");
self EnableWeaponCycling();
self takeWeapon("ray_gun");
self switchToWeapon( curgun );
}
}![]() | |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | 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 |
//Better way to code your powerup.
magic_ray_powerup( drop_item, player_won )
{
held_weap = self GetCurrentWeapon();
//I'm assuming player_won = is self or so.
SetSavedDvar("player_sustainAmmo", "1");
if(!(self HasWeapon("ray_gun"))
self GiveWeapon("ray_gun");
self SwitchToWeapon("ray_gun");
self DisableWeaponCycling();
IPrintLn("Ray Gun given");
wait 20;
SetSavedDvar("player_sustainAmmo", "0");
self EnableWeaponCycling();
self TakeWeapon("ray_gun");
self SwitchToWeapon(held_weap);
}