
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. |
function(){
//stores current gun
curgun = self getCurrentWeapon();
//ray = "ray_gun";
//givesw ray gun
self giveWeapon("ray_gun");
//switch gun
self switchToWeapon("ray_gun");
iPrintLn ("Ray gun given");
wait( 20 );
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. |
this would work if you defined self to be the player. but i would recommend disable weapon switching DisableWeapons()
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
this would work if you defined self to be the player. but i would recommend disable weapon switching DisableWeapons()
i think it is the disable weapon switching, but im to to check
What would disabling weaponswitch do?
so that the player/s can't switch to other weapons while using the given weapon. if you're gonna use this script as a power up, that's what you need to do.





![]() | 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. |
![]() Oil Rig Beta Access |
You'll want to get the player's ammo and clip as well or when it gives them the gun it will give them a full ammo weapon back

as long as you dont take the players curent weapon, and give it back again afterwards it'l be fine. just give a new weapon and disable cycling. after that take the new weapon and switch back to the old one. no ammo changed then
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
so that the player/s can't switch to other weapons while using the given weapon. if you're gonna use this script as a power up, that's what you need to do.
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
What's the code to disable weapon switching I can't find it on the scrip rerence?
self DisableWeaponCycling();![]() | |
![]() | 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 |
Do the Switch before the Disable as if you try to execute that code with Disable--- on first it won't switch.
Also "self" is defined by the entity that the function is called by, so if it's actually a player that does it then you don't need "player" variable (that's really stupid thing to say too n1)