If you post your triggers it's far easier for us to help you:
How To Post Your Trigger
Waits are tricky because Event Responses are not guaranteed to work after a Wait and they often aren't safe to use after a Wait. There's a lot to learn about how they work since their behavior can be inconsistent with one another. Just know that most of them act like global Variables which are set in response to their associated Event.
So for example when a unit dies, before Conditions/Actions execute, the Event Response (Dying unit), (Triggering unit), and (Killing unit) are all set automatically for you. This
can be an issue since the values of these Event Responses are shared globally amongst all of your triggers and like any other global variable they can only have one value set at a time. When Waits are used they create a window of opportunity for things to change, which can result in a trigger referencing the wrong Event Response or just flat out not working because their original values have been set to something else.
Here's an example of an Event Response failing after a Wait. (Target point of ability being cast) is set to null after a Wait, meaning it will no longer exist. This will result in the Footman spawning at the center of the map instead of where you cast the ability. The center of the map is the default point for when an invalid position is given.
-
Target point issue
-
Events
-
Unit - A unit Starts the effect of an ability
-
Conditions
-
(Ability being cast) Equal to Shockwave
-
Actions
-
Wait 2.00 seconds
-
Unit - Create 1 Footman for Player 1 (Red) at (Target point of ability being cast) facing Default building facing degrees
Here's a working exception to the rules and a very useful Event Response. (Triggering unit) is safe to use after Waits because it acts like a local variable:
-
Events
-
Unit - A unit Starts the effect of an ability
-
Conditions
-
Actions
-
Wait 2.00 seconds
-
Unit - Kill (Triggering unit)
(Triggering unit) is always set to the
unit mentioned in the Event -> A
unit does something...
Regarding weird behavior, here's a good example.
-
Weird behavior
-
Events
-
Unit - A unit Starts the effect of an ability
-
Conditions
-
(Unit-type of (Triggering unit)) Not equal to Dummy
-
Actions
-
Unit - Create 1 Dummy for (Triggering player) at (Center of (Playable map area)) facing Default building facing degrees
-
Unit - Order (Last created unit) to Night Elf Mountain Giant - Taunt.
-
Game - Display to (All players) for 30.00 seconds the text: (Name of (Casting unit))
-
Unit - Kill (Casting unit)
I made this trigger which says that whenever a non-Dummy unit casts a spell (ability), a Dummy unit is created which casts an instant speed Taunt ability in response. Note that Dummy units are designed to have no cast delay for their spells which is why I say "instant speed". This instant speed behavior is actually part of the reason why this weird behavior happens in the first place.
Anyway, here's where it gets weird, the (Casting unit) which I attempt to Kill is set to null after this action:
-
Unit - Order (Last created unit) to Night Elf Mountain Giant - Taunt.
This means that it's not set to anything. I'm not sure why this happens but I do know that the Dummy unit casting an ability is the cause. It's probably because two units are casting abilities at the "same time" and that causes things to break.
Long story short, smart use of global Variables, Event Responses, local variables, etc. can help remedy all of these issues.