- Joined
- Sep 12, 2008
- Messages
- 657
hi.. i tryed to make that if a player writes -bt ### it changes the variable BT to ###
i want allso it to create that if the unit has less hp than the ### it says that it doesnt have enought life to proceed.
but what it did when i tested was that if the player writes -bt 9999 it says, you dont have 999 health. and the point was 9999 writes 9999.. heres the trigger:
Notes: hero1 is a variable i setted up like this:
And bt is default 15:
i want allso it to create that if the unit has less hp than the ### it says that it doesnt have enought life to proceed.
but what it did when i tested was that if the player writes -bt 9999 it says, you dont have 999 health. and the point was 9999 writes 9999.. heres the trigger:
Code:
Player - Player 1 (Red) types a chat message containing -bt as A substring
(Triggering player) Equal to (Owner of Hero[1])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of Hero[1]) Greater than (Real((Substring((Entered chat string), 6, 10))))
Then - Actions
Set BT = (Integer((Substring((Entered chat string), 6, 10))))
Else - Actions
Game - Display to (All players) the text: ((Your medic doesnt have + (Substring((Entered chat string), 6, 10))) + health to give.)
Notes: hero1 is a variable i setted up like this:
Code:
Set Hero[1] = Medic Gunner 0001 <gen>
Code:
Set BT = 15