changing ownership for a certain time then back again

helpmeplease

New Member
Reaction score
7
im making a spell that changes all units within 500 of target position of the ability to owner of the caster, and then back into the original owner after 5 seconds. this is my stab in the dark attempt but its not working at the moment. any reason why? thanks

Trigger:
  • taking control
    • events
      • unit - a unit begins casting an ability
    • conditions
      • (ability being cast) equal to Taking Control
    • actions
      • unit group - pick every unit in (units within 500.00 of (target point of ability being cast)) and do (unit group - add picked unit) to takingcontrol)
      • special effect - i have so many of them
      • unit group - pick all units in takingcontrol and do (actions)
        • loop - actions
          • unit - change ownership of (picked unit) to (owner of (triggering unit)) and change colour
          • wait 5.00 seconds
          • unit group - pick every unit in taking control and do (actions)
            • loop - actions
              • if (all conditions are true) then do (then actions) else do (else actions)
                • if - conditions
                  • ((units-type of (picked unit)) is a structure) equal to false
                  • ((picked unit) is A hero) equal to false
                • then - actions
                  • unit - change ownership of (matching unit) to (previous owner) and change colour
                • else - actions
 

Moridin

Snow Leopard
Reaction score
144
unit - change ownership of (matching unit) to (previous owner) and change colour

This line will not work. You need to store the previous owner in a variable. Also it should be "picked unit" not "matching unit".

Another tip, use the event " Unit - A unit starts the effect of an ability" instead of "begins casting an ability".
 

tommerbob

Minecraft. :D
Reaction score
110
Also, your (matching unit) should be (picked unit). And you use the unit group 3 separate times. Try consolidating your trigger so that you only use the unit group once.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top