This "Kill Unit in Region" doesent work.

Gripen2

New Member
Reaction score
1
Code:
Antilagg
    Events
        Player - Player 1 (Red) types a chat message containing -eliminate as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in Region 005 <gen>) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Sheep
                        (Unit-type of (Picked unit)) Equal to Pig
                    Then - Actions
                        Unit - Kill (Picked unit)
                    Else - Actions

I have no idea why it doesen't work. Do you?
 

TestSubject0

New Member
Reaction score
0
if all conditions are true, meaning if its a pig and a sheep kill it, try using an or, or use 2 different if's
 

TestSubject0

New Member
Reaction score
0
What im saying is you have a condition where both have to be true to move on, and then in the conditions you have two things that can never both be true. for example, if there is a pig then it cannot be a sheep therefore it returns (True/False) and makes the whole condition False because BOTH need to be true.

try splitting it into two seperate triggers, its not the most efficient way in the world, but it can get the job done.
 

Gripen2

New Member
Reaction score
1
What im saying is you have a condition where both have to be true to move on, and then in the conditions you have two things that can never both be true. for example, if there is a pig then it cannot be a sheep therefore it returns (True/False) and makes the whole condition False because BOTH need to be true.

try splitting it into two seperate triggers, its not the most efficient way in the world, but it can get the job done.

I whas just thinking that.

I will try it soon. :)
 

Extremedesyr

New Member
Reaction score
6
solution

your -if- conditions refer to both the pig and the sheep. just make it an 'or' condition and ur fine
 

Scorpions

New Member
Reaction score
12
Try this



Code:
Antilagg
    Events
        Player - Player 1 (Red) types a chat message containing -eliminate as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in Region 005 <gen>) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    Or - Any (Conditions) are true
                          Conditions
                                  (Unit-type of (Picked unit)) Equal to Sheep
                                  (Unit-type of (Picked unit)) Equal to Pig
                    Then - Actions
                        Unit - Kill (Picked unit)
                    Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top