UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Auto turrets?

broken avatar :(
Created 12 years ago
by KDXDARK
0 Members and 1 Guest are viewing this topic.
1,853 views
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: ar
Date Registered: 21 August 2011
Last active: 1 day ago
Posts
1,323
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
Personal Quote
This game isn't meant to be played
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Mapper Has released one or more maps to the UGX-Mods community.
KDXDARK's Contact & Social Links
I wanna do the auto turrets attack the allies team when they touch a trigger, but how i do it?

original script
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_utility;
     main()
     {
     level thread manage_mg();
     }
     manage_mg()
     {
    while(1)
    {
    // SET COST HERE
    cost = 1000;
    player = undefined;
    trigs = getentarray( "activate_mg", "targetname");
    for(i = 0; i < trigs.size; i++)
    {
    trig = trigs[i];
    trig setcursorhint("HINT_NOICON");
    trig usetriggerrequirelookat();
    trig sethintstring("Press &&1 to activate Auto Turrets [Cost: " + cost + "]");
    trig waittill("trigger", player);
    if(!is_player_valid(player))
         {
            continue;
         }
    if(player.score >= cost)
         {
            level thread activate_mg();
            player playsound("cha_ching");
            player maps\_zombiemode_score::minus_to_player_score( cost );
            trig sethintstring("^3Auto Turrets ^2ON!");
            wait(30); // Wait 30 seconds and then turn them off
            trig sethintstring("Auto Turrets are currently unavailable");
            wait(120); // Cool-down for 120 seconds
            trig sethintstring("Press &&1 to activate Auto Turrets [Cost: " + cost + "]");
         }
         else
         {
            player playsound("no_cha_ching");
         }
      }
      wait(0.05);
      }
   }
         activate_mg()
      {
   mgs = getentarray( "auto_mg", "targetname" );
          for(i=0;i<mgs.size;i++)
   {
      mg = mgs[i];
      mg setTurretTeam( "allies" );
      mg SetMode( "auto_nonai" );
      mg thread maps\_mgturret::burst_fire_unmanned();
   }
   wait(30); // Leave turrets on for 30 seconds
   for(i=0;i<mgs.size;i++)
   {
      mg = mgs[i];
      mg notify("stop_burst_fire_unmanned");
      mg SetMode( "manual" );
   }
    }

i edit it
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_utility;
main()
{
automg = GetEntArray("auto_turrets","targetname");
array_thread(automg,::auto_turrets);
}
auto_turrets()
{
level thread activate_mg();
}
activate_mg()
{
   mgs = getentarray( "auto_mg", "targetname" );
          for(i=0;i<mgs.size;i++)
   {
      mg = mgs[i];
      mg setTurretTeam( "axis" );
      mg SetMode( "auto_nonai" );
      mg thread maps\_mgturret::burst_fire_unmanned();
   }
   wait(30); // Leave turrets on for 30 seconds
   for(i=0;i<mgs.size;i++)
   {
      mg = mgs[i];
      mg notify("stop_burst_fire_unmanned");
      mg SetMode( "manual" );
   }
}

this going to work?
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 6 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Scripter Elite
My Groups
More
×
YaPh1l's Groups
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Well, have you tried if it does work?

- Phil.
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: ar
Date Registered: 21 August 2011
Last active: 1 day ago
Posts
1,323
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
Personal Quote
This game isn't meant to be played
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Mapper Has released one or more maps to the UGX-Mods community.
KDXDARK's Contact & Social Links
well it attack me, but it just stop a few seconds later and dont shot

Post Merge: March 29, 2014, 07:33:28 pm
well it attack me, but it just stop a few seconds later and dont shot
if fixed it :D
Last Edit: March 29, 2014, 07:33:28 pm by KDXDARK

 
Loading ...