

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!//bgb shopping free
function bgb_shopping_free()
{
self endon("bgb_done");
self thread wait_notify(60, "bgb_done"); //1min
self thread waittill_call("bgb_done", "reset_triggers");
self.shopping_free = true;
setdvar("zombie_unlock_all", 1);
self.triggers = strTok("zombie_doors, zombie_door, zombie_airlock_buy, zombie_debris, flag_blocker, window_shutter", ", ");
wait 0.1;
foreach(trigger in triggers)
{
trigger_ent = GetEntArray(trigger, "targetname");
for(i = 0; i < trigger_ent.size; i++)
{
trigger_ent[i].old_costs = trigger_ent[i].costs;
trigger_ent[i].costs = 0;
trigger_ent[i].was_player_triggered = false;
//add check if player is self
trigger_ent[i] waittill("trigger", player);
trigger_ent[i].was_player_triggered = true;
}
}
}
function reset_triggers()
{
triggers = self.triggers;
foreach(trigger in triggers)
{
trigger_ent = GetEntArray(trigger, "targetname");
for(i = 0; i < trigger_ent.size; i++)
{
if( !trigger_ent[i].was_player_triggered )
trigger_ent[i].costs = trigger_ent[i].old_costs;
}
}
wait 0.1;
if(!self others_have_shopping_free())
setdvar("zombie_unlock_all", 0);
self.triggers = undefined;
}
function others_have_shopping_free()
{
players = GetPlayers(self.team);
foreach(player in players)
{
if(player == self)
continue;
if(player.shopping_free)
return true;
else
result = false;
}
return result;
}
function wait_notify(time, event)
{
wait time;
self notify(event);
}
function waittill_call(event, func, arg1, arg2)
{
self waittill(event);
if(isDefined( arg1 ) && isDefined( arg2 ))
self thread [[ func ]](arg1, arg2);
else if(isDefined( arg1 ) && !isDefined( arg2 ))
self thread [[ func ]](arg1);
else
self thread [[ func ]]();
}
//new bgb
function have_not_found_a_name_yet()
{
self endon("bgb_done");
range = 120;
rangeSQ = range*range; //since we're using distanceSquared
self thread electrocuting_ambient(range);
//time = &RandomIntRange(1, 3); //would be better because i wont get results like 0.11
time = &RandomFloatRange(0.1, 0.3);
self waittill("player_used_bgb");
AI = GetAITeamArray("axis");
AI = self getClosest(AI, rangeSQ);
for(i = 0; i < AI.size; i++)
{
AI[i] FreezeControls(true); //idk how to freeze a zombie lol
fx_duration = RandomFloatRange(0.1, 0.3);
wait time; //or time/10 if I use IntRange
self notify("electrocuting_zombies");
while(fx_duration <= 0)
{
//bo2's fx - don't know bo3's fx
PlayFxOnTag(level._effect["prox_grenade_player_shock"], AI[i], "j_head");
PlayFxOnTag(level._effect["prox_grenade_player_shock"], AI[i], "J_Spine1");
PlayFxOnTag(level._effect["prox_grenade_player_shock"], AI[i], "J_Spine4");
PlayFxOnTag(level._effect["prox_grenade_player_shock"], AI[i], "pelvis");
fx_duration -= 0.09; //just to add more randomness
wait 0.05;
}
wait 0.05;
AI[i] FreezeControls(false);
AI[i] DetachAll();
AI[i] DoDamage(AI[i].health + 1, self.origin, self);
self zm_score::add_to_player_score(100); //or less idk
}
}
function electrocuting_ambient(range)
{
self endon("bgb_done");
self waittill("electrocuting_zombies");
pos = self.origin;
PlaySoundAtPosition("wpn_taser_mine_zap", pos); //bo2's sound
Earthquake(0.22, 0.4, pos, range);
}
function getClosest(ents, rangeSQ, is_squared = true) //SQ = squared
{
index = 0;
newArr = []
if(!is_squared)
rangeSQ *= rangeSQ;
for(i = 0; i < ents.size; i++)
{
if(DistanceSquared(self.origin, ents[i].origin) <= rangeSQ)
{
newArr[index] = ents[i];
index++;
}
}
return newArr;
}
![]() | Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms. |
You cannot edit posts until you reach 20 posts on the forum. (Anti spam measure)
I can remove those for you.