Posts
114
Respect
10Add +1
Forum Rank
Pack-a-Puncher
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!

paypal.me/F3ARxReaper666![]() | 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. |
Yet another problem with my Gobblegum script... When I call the "gumball" function, (that is where it picks a random number and gives you the gumball), it picks a random number, but doesn't thread the gobblegum that it chose. Script (Simplified)
Double Post Merge: January 04, 2017, 03:04:36 am
Also, even though I have a playable area trigger, the powerups from the "Kill Joy", "Dead of Nuclear Winter", etc... Doesn't spawn them anymore.
thread gumball();player thread gumball();
gumball()
{
gum = RandomIntRange( 0,4 ); // <min value>, <max value> | zero counts as a number!
switch( gum )
{
case 0:
iprintln("Case 0");
player thread anywhere_but_here();
break;
case 1:
iprintln("Case 1");
player thread dead_of_nuclear_winter();
break;
case 2:
iprintln("Case 2");
player thread cache_back();
break;
case 3:
iprintln("Case 3");
player thread kill_joy();
break;
default:
break;
}
}
cache_back()
{
//iprintln("cache_back function activated");
for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == "full_ammo" )
{
level.zombie_powerup_index = i;
break;
}
}
player = get_players();
level.zombie_vars["zombie_drop_item"] = 1;
level.powerup_drop_count = 0;
wait(1);
level thread maps\_zombiemode_powerups::powerup_drop(player.origin + (100, 0, 10));
}
cache_back()
{
//iprintln("cache_back function activated");
for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == "full_ammo" )
{
level.zombie_powerup_index = i;
break;
}
}
level.zombie_vars["zombie_drop_item"] = 1;
level.powerup_drop_count = 0;
wait(1);
level thread maps\_zombiemode_powerups::powerup_drop(self.origin + (100, 0, 10));
}
![]() | 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. |
When I put player thread in the gumball() function, it says that it is an uninitialized variable...
oh my bad, when a script is called by a player, self is whats used to thread other threads, so chnage all the players in gumball to self
![]() | 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. |
gumball_machine waittill("trigger", player);
player thread function_name();