• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Typing Player kills

Status
Not open for further replies.

sentrywiz

S

sentrywiz

Woah, I need help. again... :D:D:D

Anyways, anybody knows how to make a trigger where a player types a number of kills/rounds/lives etc?

Im guessing something with substrings but I never tried it but now I need it so... yeah :D
 
This should do the trick:

  • Untitled Trigger 004
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to Untitled Trigger 008 <gen> the event (Player - (Player((Integer A))) types a chat message containing -kills as A substring)
  • Untitled Trigger 008
    • Events
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to -kills
    • Actions
      • Set i = (Integer((Substring((Entered chat string), 8, (Length of (Entered chat string))))))
typing

-kills 30

will result in 30 stored in integer i.
 
This looks really complex... but I'll give it a go and just blindly believe :D
Thanks though!
 
Why not using "8, 9" or something like that to start from 8?

I'm using 8, length of string, so it does start from 8.

So if one types -kills 1 it will pick the 1. If one types 10 it will pick the 10. If one types 1000 it will pick the 1000.

1, 6, will result in also 30, because Integer can't read string, right ?

What? 1,6 just checks that the string begins with -kills.
 
Status
Not open for further replies.
Back
Top