- Joined
- Jan 23, 2020
- Messages
- 86
I have created a system to send gold/lumb to players via commands: "-gg <gold amount> <player color>" but if they type it with a non-numerical value ie, "-gg -10000 red" it will cause the system to ignore its conditions.
What condition would solve this?
What condition would solve this?
-
sendgold
-
Events
- Player - Player 1 (Red) types a chat message containing -gg as A substring
- Player - Player 2 (Blue) types a chat message containing -gg as A substring
- Player - Player 3 (Teal) types a chat message containing -gg as A substring
- Player - Player 4 (Purple) types a chat message containing -gg as A substring
- Player - Player 5 (Yellow) types a chat message containing -gg as A substring
- Player - Player 6 (Orange) types a chat message containing -gg as A substring
- Player - Player 7 (Green) types a chat message containing -gg as A substring
- Player - Player 8 (Pink) types a chat message containing -gg as A substring
- Conditions
-
Actions
- Set VariableSet PN = (Player number of (Triggering player))
-
For each (Integer A) from 5 to (Length of (Entered chat string)), do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Substring((Entered chat string), (Integer A), (Integer A))) Equal to
-
Then - Actions
- Set VariableSet playerGold = (Integer((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string))))))
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to red) then do (Set VariableSet playerGold = 1) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to blue) then do (Set VariableSet playerGold = 2) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to teal) then do (Set VariableSet playerGold = 3) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to purple) then do (Set VariableSet playerGold = 4) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to yellow) then do (Set VariableSet playerGold = 5) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to orange) then do (Set VariableSet playerGold = 6) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to green) then do (Set VariableSet playerGold = 7) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to pink) then do (Set VariableSet playerGold = 8) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to gray) then do (Set VariableSet playerGold = 9) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to light blue) then do (Set VariableSet playerGold = 10) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to dark green) then do (Set VariableSet playerGold = 11) else do (Do nothing)
- If ((Substring((Entered chat string), ((Integer A) + 1), (Length of (Entered chat string)))) Equal to brown) then do (Set VariableSet playerGold = 12) else do (Do nothing)
- Set VariableSet amountGold = (Integer((Substring((Entered chat string), 5, (Integer A)))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering player) Current gold) Greater than or equal to amountGold
- ((Triggering player) is an ally of (Player(playerGold)).) Equal to True
- ((Player(playerGold)) slot status) Equal to Is playing
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GoldLimit[PN] Less than or equal to 25000
-
Then - Actions
- Game - Display to (Player group((Triggering player))) the text: (You gave + ((String(amountGold)) + ( |cffffff00gold|r to player + (Name of (Player(playerGold))))))
- Player - Add amountGold to (Player(playerGold)).Current gold
- Player - Add (amountGold x -1) to (Triggering player).Current gold
- Set VariableSet GoldLimit[PN] = (GoldLimit[PN] + amountGold)
- Game - Display to (Player group((Triggering player))) the text: (Gold send limit + ((String(GoldLimit[PN])) + /25000))
- Game - Display to (Player group((Player(playerGold)))) the text: (<Empty String> + ((Name of (Triggering player)) + ( sent you |cffffff00 + ((String(amountGold)) + gold|r))))
-
Else - Actions
- Game - Display to (Player group((Triggering player))) the text: Gold send limit rea...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
- Game - Display to (Player group((Triggering player))) the text: You havent got that...
-
If - Conditions
- Skip remaining actions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events