Melee Initialization
Events
Conditions
Actions
Set [COLOR="Red"]Gold[/COLOR] = (Player 1 (Red) Current gold)
Untitled Trigger 001
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 16, do (Actions)
Loop - Actions
Set PlayerGoldArray[(Integer A)] = ((Player((Integer A))) Current gold)
Untitled Trigger 002
Events
Player - Player 1 (Red) types a chat message containing greedisgood as A substring
Conditions
(Player 1 (Red) Current gold) Greater than PlayerGoldArray[1]
Actions
Player - Set Player 1 (Red) Current gold to PlayerGoldArray[1]
I think I know what you want to do as your trigger is called anti-greedisgood so this is what I have made:
Every second it stores all players gold into a variableCode:Untitled Trigger 001 Events Time - Every 1.00 seconds of game time Conditions Actions For each (Integer A) from 1 to 16, do (Actions) Loop - Actions Set PlayerGoldArray[(Integer A)] = ((Player((Integer A))) Current gold)
If they type greedisgood then that trigger will run and set them back to the gold they had the last second ago eliminating their cheated gold.Code:Untitled Trigger 002 Events Player - Player 1 (Red) types a chat message containing greedisgood as A substring Conditions (Player 1 (Red) Current gold) Greater than PlayerGoldArray[1] Actions Player - Set Player 1 (Red) Current gold to PlayerGoldArray[1]
It would be easier for us to help if you'd exactly say what you want to do in-gamewise.
Cheers
I think I know what you want to do as your trigger is called anti-greedisgood so this is what I have made:
Every second it stores all players gold into a variableCode:Untitled Trigger 001 Events Time - Every 1.00 seconds of game time Conditions Actions For each (Integer A) from 1 to 16, do (Actions) Loop - Actions Set PlayerGoldArray[(Integer A)] = ((Player((Integer A))) Current gold)
If they type greedisgood then that trigger will run and set them back to the gold they had the last second ago eliminating their cheated gold.Code:Untitled Trigger 002 Events Player - Player 1 (Red) types a chat message containing greedisgood as A substring Conditions (Player 1 (Red) Current gold) Greater than PlayerGoldArray[1] Actions Player - Set Player 1 (Red) Current gold to PlayerGoldArray[1]
What if it's too slow and the variable is overwritten with the amount after the cheat has been used?
Why would you need to use a variable? Couldn't you just put 9999999 there?
unfortunately, when a player types a cheat it is not considered a string and it wont be detected
Untitled Trigger 001
Events
Unit - A unit Dies
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Killing unit)) Equal to Player 1 (Red)
Then - Actions
Set GoodGold[1] = (GoodGold[1] + (Point-value of (Triggering unit)))
Else - Actions
Do nothing
Untitled Trigger 002
Events
Time - Every 0.25 seconds of game time
Conditions
Actions
Player - Set Player 1 (Red) Current gold to GoodGold[1]