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

[General] Unit dies > Created again based -kills ##

Status
Not open for further replies.
Level 4
Joined
Dec 16, 2013
Messages
84
I need help,
I want to make unit spawn many times based on -Kills ##
like so:
Player 1 type -Kills 8 (could be any number)
Then Create 1 unit footman, but when the footman dies. He will created/spawned again 8 times (# = -kills 8).
Its like, spawn - die - repeat 8 times

sorry for my english, hope you understand
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
You need to store the kills to a variable like this
  • Event
    • Player - Player 1 (Red) types a chat message containing -kills as a substring
  • Condition
    • Substring(Entered chat string, 1, 7) Equal to -kills
  • Action
    • Set kills = Integer(Substring(Entered Chat string, 8, Length of Entered Chat String) )
this means that if your enter -kills 9, the kills variable will be equal to 9
since it will convert the string starting from the the eigth character up to the end (hence length of entered chat string). Anyway you can just copy this if you dont understand.

Now you can use condition like
If numberOfDeaths less than kills then
Revive the unit.

Note: Only player 1 can type the -kills command. If you want anyplayer, just add them to the event like this
  • Player - Player 1 (Red) types a chat message containing -kills as a substring
  • Player - Player 2 (Blue) types a chat message containing -kills as a substring
 
Status
Not open for further replies.
Top