How to Give Gold and Lumber

gwcadu942

New Member
Reaction score
0
I am making a cheat for gold, so when you type -gg 01 300 it gives player 01 300 gold (-gg (player number) (amount of gold)). But if I type -gg 13 300 the game crashes, because there are only 12 players. So how can I make the trigger ignore the command if I type -gg (number bigger than 12) 300?:( I tried many ways but I found only one and its to make a different trigger for every player (eg. if I type -gg 01 300 - a trigger for player 01, if I type -gg 02 300 - a new trigger for player 02..).

-ggold is gold
-glumber is lumber
 

Hellohihi

New Member
Reaction score
42
Convert the playernumber substring of entered string to integer.

And then check if converted string is > 12.
 

LordXavier

TH.net Regular
Reaction score
16
Trigger:
  • Gold Cheat
    • Events
      • Player - Player 1 (Red) types a chat message containing -gg as An exact match
    • Conditions
      • (Substring((Entered chat string), 1, 4)) Equal to -gg
    • Actions
      • Player - Add (Integer((Substring((Entered chat string), 5, (Length of entered chat string)))))) to (Triggering player) Current Gold

-gg (in the condition and events) needs to have a space after it unless you want it to look like this: -gg100
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top