D
DarkKronos
Guest
I want to be able to type -buy (item) then give the person the item.
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
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)
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)
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.
set *your unit variable* = last created unit
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
Set Hero[Player number of (Owner of Entering unit)]= Last created unitDarkKronos said:how do i do it if hero is made by trigger
(i cant select a unit on map)