• 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.

Player Dying + Adding Gold

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
How to make,when hero dies,a msg saying "He died by she and got 2036 gold" and how to add the gold amount for the team Owner of Killing Unit ??
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Create a Integer type variable and call it "Gold".
Trigger
Event: A unit dies
Condition: Triggering Unit is A hero equal to True
Actions: ->
-> Set Gold = Your Gold Share Formula. Can be "Level of Triggering Unit x 100" or "Current gold of Owner of Triggering Unit / 10" etc.
-> Player - Add Gold x -1 to owner of triggering unit
-> Player - Add Gold to owner of killing unit
-> Game - Display text message to (All Player) Displaying "Name of Owner of Triggering Unit" dies by "Name of Owner of Killing Unit" and got "Gold (The integer variable)" Gold. You have to use some concatenated strings for this

String 1: Name of Owner of Triggering Unit
String 2 = Concatenated Strings
String 2.1 = " died by "
String 2.2 = Concatenated Strings
String 2.2.1 = Name of Owner of Killing Unit
String 2.2.2 = Concatenated Strings
String 2.2.2.1 = " and got "
String 2.2.2.2 = Concatenated Strings
String 2.2.2.2.1 = Conver Integer to String (Gold)
String 2.2.2.2.2 = " gold"
 
Status
Not open for further replies.
Top