• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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