get Damage, the trigger will not work

Status
Not open for further replies.
Level 5
Joined
May 8, 2020
Messages
90
when using command -die1 that user's hero will die but when taking damage will not die.
But when not taking damage within 5 seconds of the countdown, it can be used again
how can i do that
 
I don't really understand what you want so I'll just show you different examples:

Track each Player's hero:
  • Set Player Hero
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Set VariableSet PlayerHero[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Prevent heroes from dying from damage (version 1.31+ required):
  • Damage Cant Kill
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • PlayerHero[(Player number of (Owner of (Damage Target)))] Equal to (Damage Target)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Life of (Damage Target)) - (Damage taken)) Less than or equal to 0.45
        • Then - Actions
          • Event Response - Set Damage of Unit Damaged Event to 0.00
          • Unit - Set life of (Damage Target) to 0.45
        • Else - Actions
This isn't ideal and I can't guarantee that it will work 100% of the time.

Damage command which can only be used if the CanUseDieCommand boolean is false:
  • Damage Command
    • Events
      • Player - Player 1 (Red) types a chat message containing -die1 as An exact match
      • Player - Player 2 (Blue) types a chat message containing -die1 as An exact match
      • Player - Player 3 (Teal) types a chat message containing -die1 as An exact match
    • Conditions
      • CanUseDieCommand[(Player number of (Triggering player))] Equal to True
    • Actions
      • Unit - Kill PlayerHero[(Player number of (Triggering player))]
You can set CanUseDieCommand[player number] to False whenever you want to disable it for a given player.
 
Last edited:
I mean when that player use command : -die1 will kill his hero .
but when attacked by other players ( hit or use spell ) will be disabled.
If in 5 seconds no longer take damage from the player (attack or magic) will be able to use the command -die1 again
 
Status
Not open for further replies.
Back
Top