• 🏆 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!

[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