• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Health command

Status
Not open for further replies.
Level 3
Joined
Apr 13, 2009
Messages
49
Hey,

I'm looking for a trigger that shows the health from a selected unit in a game message by using the command -health.

I have no idea how to make this though. Would it be possible for anyone helping me create one please?

Thanks
 
Level 8
Joined
Feb 15, 2009
Messages
463
  • Custom Script: call DisplayTextToForce(bj_FORCE_ALL_PLAYERS , R2S(GetUnitState(GetSelectedUnit() , UNIT_STATE_LIFE )
or in jass:
JASS:
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS , R2S(GetUnitState(GetSelectedUnit() , UNIT_STATE_LIFE )
 
Level 8
Joined
Mar 12, 2008
Messages
437
  • Chocolate cupcakes
    • Events
      • Player - Player 1 (Red) types a chat message containing -health as An exact match
      • Repeat the above for all players that may write the command.
    • Conditions
      • Your conditions here
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
        • Loop - Actions
          • Game - Display to (Player group((Triggering player))) the text: (String((Integer((Life of (Picked unit))))))
For example, if a player has selected two grunts, and they have 239.22 hp and 593.89 hp, it will show this message:

240
594
 
Level 8
Joined
Feb 15, 2009
Messages
463
Angel i rather teach him right then having him rework all his code in 2 months again coz he has new mapping skillz
its my way of teaching coz im not a great master of sentences and i feel sorry for that but everyone will learn more if he has to get all a bit from himself then just pasting
 
Status
Not open for further replies.
Top