


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!heres the logic im trying to achieve-
https://imgur.com/U2XD5W0
gun_machine()
{
zombie_ppsh = getEnt("zombie_ppsh","targetname"); //zombie_ppsh
zombie_mg42 = getEnt("zombie_mg42","targetname"); //zombie_mg42
zombie_cymbal_monkey = getEnt("zombie_cymbal_monkey","targetname"); //zombie_cymbal_monkey
zombie_ppsh hide();
zombie_mg42 hide();
zombie_cymbal_monkey hide();
trig = getEnt("gun_machine_trig", "targetname");
trig setHintString("Press X to browse gun catalogue");
trig setCursorHint("HINT_NOICON");
pistol = getEnt("pistol", "targetname"); //buy weapon
melee = getEnt("melee", "targetname"); //cycle thru weapons
trig waittill ("trigger", player);
zombie_ppsh show();
trig setHintString("PPSH - [Cost 100] 'Shoot' to buy, OR 'Melee' to see next weapon");
while(1)
{
melee waittill ("trigger", player);
zombie_ppsh hide();
zombie_mg42 show();
trig setHintString("MG42 - [Cost 100] 'Shoot' to buy, OR 'Melee' to see next weapon");
melee waittill ("trigger", player);
zombie_mg42 hide();
zombie_cymbal_monkey show();
trig setHintString("MONKEY's - [Cost 100] 'Shoot' to buy, OR 'Melee' to see next weapon");
melee waittill ("trigger", player);
zombie_cymbal_monkey hide();
zombie_ppsh show();
trig setHintString("PPSH - [Cost 100] 'Shoot' to buy, OR 'Melee' to see next weapon");
}
while(1)
{
pistol waittill ("trigger", player);
if (player.score >= 100)
{
primariesList = player getWeaponsListPrimaries(); //checks how many weapons player has
if( primariesList.size >= 2 ) // ok, you have bla bla, ill now proceed accordingly
{
iPrintLnBold ("Sorry. Both Weapon Slots Filled Already!"); // should only see this if i have 2(+) weapons
}
else
{
player maps\_zombiemode_score::minus_to_player_score( 100 );
player giveWeapon("zombie_ppsh");
player switchToWeapon("zombie_ppsh");
player giveStartAmmo("zombie_ppsh");
player giveMaxAmmo("zombie_ppsh");
iPrintLnBold("PPSH Acquired");
}
}
else
{
iPrintLnBold("Insuficient Funds Available");
}
}
while(1)
{
pistol waittill ("trigger", player);
if (player.score >= 100)
{
primariesList = player getWeaponsListPrimaries();
if( primariesList.size >= 2 )
{
iPrintLnBold ("Sorry. Both Weapon Slots Filled Already!");
}
else
{
player maps\_zombiemode_score::minus_to_player_score( 100 );
player giveWeapon("zombie_mg42");
player switchToWeapon("zombie_mg42");
player giveStartAmmo("zombie_mg42");
player giveMaxAmmo("zombie_mg42");
iPrintLnBold("MG42 Acquired");
}
}
else
{
iPrintLnBold("Insuficient Funds Available");
}
}
while(1)
{
pistol waittill ("trigger", player);
if (player.score >= 100)
{
primariesList = player getWeaponsListPrimaries();
if( primariesList.size >= 2 )
{
iPrintLnBold ("Sorry. Both Weapon Slots Filled Already!");
}
else
{
player maps\_zombiemode_score::minus_to_player_score( 100 );
player giveWeapon("zombie_cymbal_monkey");
player switchToWeapon("zombie_cymbal_monkey");
player giveStartAmmo("zombie_cymbal_monkey");
player giveMaxAmmo("zombie_cymbal_monkey");
iPrintLnBold("MONKEY's Acquired");
}
}
else
{
iPrintLnBold("Insuficient Funds Available");
}
}
}
Actually, what are you trying to do here, you're psuedo code is not really specific and what do you mean by "lot"?
heres a vid of what im trying to do. its what ive done so far. i just need to sort the [select] bit out now. which is why i need 2 trigs to remain active and the player can choose from 1 of the 2 & depending on which one they choose depends on whether the script 'proceeds' or returns to start.
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
You need to thread the methods to achieve your goal.
you know...
self thread Test1();
self thread Test2();
self thread Test3();
Like a crossway where you can task your workers to do stuff for you.