Need help with triger

D

DarkKronos

Guest
I want to be able to type -buy (item) then give the person the item.
 
D

DarkKronos

Guest
-.- dude ever played sheep tag reborn that has -buy, so it does got it?
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Maybe lots of separate triggers or conditions what checks the entered string and creates the right item.
 

BlackDiamond

New Member
Reaction score
15
Code:
Events:
Player 1 types...-buy X item as an exact match
Conditions:
Actions:
Custom Script: set bj_want destroy group equal to true
Pick all heroes in playable map area and do actions
Loop Actions:
Give X item to picked unit
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
@Black Diamond, You cannot simply transform the entered string 'X' in an item.

I think the solution would be a separate trigger for each item. Lot's of ifs i don't think it would work, cuz the event would be 'enters "-buy"' and I don't think you are able to check if the player wrote something else after the -buy.

Anyway, afterall, why don't you follow Mini-Me's device? Ask the map creators themselves.

BTW, can you give me a link to this map?
 
D

DarkKronos

Guest
i ment a differnt trigger for each item. all i wont is to type -buy golem and u get a stone tokin (item) in your iventry like on sheep tag reborn (str)

and if u have msn i can send u the map
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
If you wanted this, then here's a trigger:

Code:
Stone Token
    Events
        Player - Player 1 (Red) types a chat message containing -buy golem as An exact match
    Conditions
    Actions
        Hero - Create Stone Token and give it to (your hero here)
 
P

PIFbg

Guest
I think what they used in SHEEP TAG is this:

1. You have to create some variables:
HeroRED - Unit
HeroBlue - Unit
etc
2. You have to set the variables:

Set HeroRED equal to (Some Unit)
3.
Code:
    Events
        Player - Player 1 (Red) types a chat message containing -buy Invisible Sheep as An exact match
    Conditions
    Actions
        Hero - Create Invisible Sheep and give it to (HeroRED)
 

N2o)

Retired.
Reaction score
51
smith_s9 said:
@Black Diamond, You cannot simply transform the entered string 'X' in an item.

I think the solution would be a separate trigger for each item. Lot's of ifs i don't think it would work, cuz the event would be 'enters "-buy"' and I don't think you are able to check if the player wrote something else after the -buy.

Substrings?
 
D

DarkKronos

Guest
how do i do it if hero is made by trigger :confused:
(i cant select a unit on map)
 

N2o)

Retired.
Reaction score
51
Make a unit variable and do:
Code:
set *your unit variable* = last created unit
 

Drakens

New Member
Reaction score
7
you can make some Array system, like setting all the items and strings in arrays...
Set ItemString[1]= "potion"
...
Set Item[1]= the potion item
...
And then a trigger like this:
Code:
Events:
      Player1 (Red) enters a chat message containing "-buy " as a substring // Repeat for each player
Conditions:
Actions:
      if (entered chat string (6 - lenght of (entered chat string)) = ItemString[1]
      then do give Item[1] to player
      else do nothing
I'm not sure if you can do this, or if there is an easier way :eek: (maybe using interger A or something...)

DarkKronos said:
how do i do it if hero is made by trigger :confused:
(i cant select a unit on map)
Set Hero[Player number of (Owner of Entering unit)]= Last created unit
/\ this only works if you select heros by entering on a region, if you are using another method change the "Player number of (Owner of Entering Unit)" To something that works :p
 
D

DarkKronos

Guest
aarrrrrrrrrrrrrrrrrrrrrr maybe im not cut out for all this i dun know how to do it grrrr




(entered chat string (6 - lenght of (entered chat string)) cant figure that shit out and how u do this Set Item[1]= the potion item



Events:
Player1 (Red) enters a chat message containing "-buy " as a substring // Repeat for each player
Conditions:
Actions:
if (entered chat string (6 - lenght of (entered chat string)) = ItemString[1]
then do give Item[1] to player
else do nothing :banghead: :banghead: :banghead: :banghead:
 

N2o)

Retired.
Reaction score
51
what he has done is a substring and for that item[1] you need a variable.
when in trigger editor press ctrl+b and create an item-type variable.
 
D

DarkKronos

Guest
how will the trigger know wat item i want if it just has a name :confused:
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top