Posts
503
Respect
360Add +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!
) just its funny )

////// add in main gsc of your map /////////
main()
{
maps\_load::main();
thread random_weapons();
}
/////// random weapons for allies /////////
random_weapons()
{
weapArray = [];
weapArray[ weapArray.size ] = "m1garand";
weapArray[ weapArray.size ] = "colt";
weapArray[ weapArray.size ] = "thompson";
weapArray[ weapArray.size ] = "MachineGuns";
weapArray[ weapArray.size ] = "m1carbine";
weapArray[ weapArray.size ] = "springfield";
weapArray[ weapArray.size ] = "svt40";
weapArray[ weapArray.size ] = "Shotgun";
keys = GetArrayKeys( weapArray );
return weapArray[RandomInt( weapArray.size )];
}



main()
{
// other code
thread chooseWeaponClass();
// other code
}
chooseWeaponClass( howManyCanSpawn )
{
// Add classes here
// You can stress/bug test a class by commenting out the rest
weaponClass = [];
weaponClass[weaponClass.size] = "Defender";
weaponClass[weaponClass.size] = "Attacker";
weaponClass[weaponClass.size] = "Stealer";
weaponClass[weaponClass.size] = "Kamikaze";
// Cycle and choose classes going
// Then spawn.
for( x = 0 ; x < howManyCanSpawn ; x++ )
{
eSpawner = undefined;
tempClass = array_randomize( weaponClass );
classToSpawn = tempClass[RandomInt( tempClass.size )];
guyWeapon = thread weaponClassThink( classToSpawn );
switch( guyWeapon )
{
//case "ptrs41":
//case "kar98k":
//case "gewehr43":
//case "shotgun":
case "thompson":
case "m1garand":
eSpawner = findSpawnerScript( "rifle" );
break;
case "m2_flamethrower":
eSpawner = findSpawnerScript( "flame" );
break;
case "stg44":
case "mp40":
eSpawner = findSpawnerScript( "smg" );
break;
default:
eSpawner = findSpawnerScript( "rifle" );
break;
}
wait( 0.3 );
eSpawned = eSpawner doSpawn();
if( spawn_failed( eSpawned ) )
{
// empty check
}
else
{
eSpawned thread spawnEvent( classToSpawn, guyWeapon );
//eSpawned thread flyingBodies();
}
}
}
help me


![]() | 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 |
ai animscripts\shared::placeWeaponOn( "m1garand", "right" );
ai animscripts\shared::detachWeapon( ai.primaryweapon );

![]() | 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 |
this is part code for which example from two

ai animscripts\shared::placeWeaponOn( "m1garand", "right" );
//or
ai animscripts\shared::detachWeapon( ai.primaryweapon );

![]() | 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 |
). else if( IsDefined( self.script_banzai_spawn ) )
{
self thread maps\_banzai::spawned_banzai_immediate();
}
self animscripts\shared::placeWeaponOn( "m1garand", "right" );