CroMoX
New Member
- Reaction score
- 2
Hey guys, I've been trying to make a trigger, where a Hero walks near a Spider Egg, and if they get in range by 300, the egg dies and creates a Tiny Spider.
Note: I have a respawn trigger so using
Unit - A unit comes within 256.00 of Spider Egg 0084 <gen>
Will not work, since I want the eggs to respawn so this trigger can happen multiple times.
I did get a code from the Hiveworkshop, but it doesn't work;
Note: I have a respawn trigger so using
Will not work, since I want the eggs to respawn so this trigger can happen multiple times.
I did get a code from the Hiveworkshop, but it doesn't work;
Code:
Spider Egg
Events
Time - Every 0.20 seconds of game time
Conditions
Actions
Set Eggs_Unitgroup = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Spider Egg) and (((Matching unit) is alive) Equal to True)))
Unit Group - Pick every unit in Eggs_Unitgroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 325.00 of (Position of (Picked unit)))) Equal to 0
Then - Actions
Unit - Kill (Matching unit)
Unit - Create 1 Tiny Spider for (Owner of (Matching unit)) at (Position of (Matching unit)) facing Default building facing degrees
Else - Actions