Ok It is kinda complicated, but not too much so. Basically the way codes work is they don't actually save the information, they just take a few strings, in our case a name and a number, and encrypts it. then when the player types the name in, it decrypts it.
First, to encrypt the code, we will use a string array of size 9. set the code [0] to be abcdefghijklmnopqrstuvwxyz1234567890`~!@#$%^&*()-_=+[{]}\|;:'",<.>/? (just copy paste this) then set each array slot to be a different random set of numbers and letters. make sure not to repeat a letter or number, and leave the `~!@#$%^&*()-_=+[{]}\|;:'",<.>/? as it is.
Code:
Set Codes
Events
Map initialization
Conditions
Actions
Set Code[0] = abcdefghijklmnopqrstuvwxyz1234567890`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[1] = qw1ertyu29iopas4dfg8hjkl3z7xc0vb56nm`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[2] = za6qwsx5cd0e7rfv4bg3t8yhnm2jui9kl1op`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[3] = qaz3w1sx8edc6rfvtgb2974yhn5ujm0ikolp`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[4] = pqo5wieu93rytl6ak2sjdhf04gz7mx1n8cbv`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[5] = plkon5m0jiuh49bv18c6xzasdf37gy2trewq`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[6] = mzx2n5bcv8akjsh63dg9fqp7o0wei41uryt`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[7] = qaz2e5dc0tgb69ujmo7lws3xrf4vy8h1nikp`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[8] = g4fjdk03sla95yturi8eo2wpq6bvn7c1hmxz`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
Set Code[9] = po5iuy0e1wq946astrdfg3hjk7lm2nb8vcxz`~!@#$%^&*()-_=+[{]}\|;:'",<.>/?
now we have a basis for our codes. now we need to make a trigger to use them. It will take the string we are saving, and set each letter/number to be the codeset's counterpart. for example
a=g
b=4
c=y
d=e
etc...
To do this, we will make a set of 2 loops, one inside the other, to check each letter/number of the string and change it to the codset. now you may have been wondering why we made 9 codesets? well we will have 1 number in front of the code that will
not be encrypted, and will refrence to the codeset we used. to start off, lets set the string so we can encrypt it.
First set a variable called CodeSet to a random number between 1 and 9, this will be the set we use. now we make another string array called SaveCode sized to 12, or however many players you have. Set the string to ((string(codeset)) + ( Substring (player name of (triggering player)), 1, 3) + (string(Score)))) This sets the first number to be the random number picked, the code set we are using, and the second third and fourth letters to be the first 3 letters of the players name (so people cant steal it). then it sets the last numbers to be (score) whish is an integer variable i made that represents the score the player has (you set this however you normaly do, just make sure its updated when they save). Now the code will read something like this:
5Age923
the last numbers could be anything from 2 to 4950 so make sure it's at the end so we can read it accuratly. your trigger should look something like this:
Code:
Save
Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Player - Player 2 (Blue) types a chat message containing -save as An exact match
Player - Player 3 (Teal) types a chat message containing -save as An exact match
Player - Player 4 (Purple) types a chat message containing -save as An exact match
Player - Player 5 (Yellow) types a chat message containing -save as An exact match
Player - Player 6 (Orange) types a chat message containing -save as An exact match
Player - Player 7 (Green) types a chat message containing -save as An exact match
Player - Player 8 (Pink) types a chat message containing -save as An exact match
Player - Player 9 (Gray) types a chat message containing -save as An exact match
Player - Player 10 (Light Blue) types a chat message containing -save as An exact match
Player - Player 11 (Dark Green) types a chat message containing -save as An exact match
Player - Player 12 (Brown) types a chat message containing -save as An exact match
Conditions
Actions
Set PlayerNum = (Player number of (Triggering player))
Set CodeSet = (Random integer number between 1 and 9)
Set SaveCode[PlayerNum] = ((String(CodeSet)) + ((Substring((Name of (Triggering player)), 1, 3)) + (String(Score))))
(note i set the player number to be a variable for easy use)
Now to encrypt it. First we have to put the string into an array, one letter/number per array slot, make sure the size is bigger than you will need, so we dont run out of room. Now to change each letter/number to its code counterpart, we make a double-loop, that is a loop inside a loop. make the first one go from 2 to (string length of (SaveCode[PlayerNum])) so that it will set all the number/letters starting with 2 (skipping the codeset num) and endin with however long the save code is. then make another loop that goes from 1 to 68, the length of our codeset strings.
Now make an If - Then - Else and in the condition check if Encrypt(integer A) is equal to (Substring(Code[0], (Integer B), (Integer B))). that will just check the slot its on and see if the number/letter is the same as the number/letter of each one in the standard codeset, [0]. Now for out Then actions we use Set Encrypt[(Integer A)] = (Substring(Code[CodeSet], (Integer B), (Integer B))). this sets the array number we are on to equal the letter matched, except on the codeset, so it will be different. now we have out encrypted string, but its scattered in the array, so lets put it back together again by setting SaveCode to be Encrypt[1] + encrypt[2] + encrypt[3] etc on up to however big you code can be. and there we have it! a fully encrypted save code, ready for display! make sure the code displayed for a fair amount of time, so the player can write it down, and for easy remembering set it all to caps. if you code gets fairly long consider putting -'s every once in a while to make it easier to read. now your trigger should look something like this:
Code:
Save
Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Player - Player 2 (Blue) types a chat message containing -save as An exact match
Player - Player 3 (Teal) types a chat message containing -save as An exact match
Player - Player 4 (Purple) types a chat message containing -save as An exact match
Player - Player 5 (Yellow) types a chat message containing -save as An exact match
Player - Player 6 (Orange) types a chat message containing -save as An exact match
Player - Player 7 (Green) types a chat message containing -save as An exact match
Player - Player 8 (Pink) types a chat message containing -save as An exact match
Player - Player 9 (Gray) types a chat message containing -save as An exact match
Player - Player 10 (Light Blue) types a chat message containing -save as An exact match
Player - Player 11 (Dark Green) types a chat message containing -save as An exact match
Player - Player 12 (Brown) types a chat message containing -save as An exact match
Conditions
Actions
Set PlayerNum = (Player number of (Triggering player))
Set CodeSet = 0
Set SaveCode[PlayerNum] = <Empty String>
For each (Integer A) from 1 to 20, do (Actions)
Loop - Actions
Set Encrypt[(Integer A)] = <Empty String>
Set IsCryptic[(Integer A)] = False
Set CodeSet = (Random integer number between 1 and 9)
Set SaveCode[PlayerNum] = ((String(CodeSet)) + ((Substring((String((Name of (Player(PlayerNum)))) as Lower case), 1, 3)) + (String(Score))))
For each (Integer A) from 1 to (Length of SaveCode[PlayerNum]), do (Actions)
Loop - Actions
Set Encrypt[(Integer A)] = (Substring(SaveCode[PlayerNum], (Integer A), (Integer A)))
For each (Integer A) from 2 to (Length of SaveCode[PlayerNum]), do (Actions)
Loop - Actions
For each (Integer B) from 0 to 68, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Encrypt[(Integer A)] Equal to (Substring(Code[0], (Integer B), (Integer B)))
IsCryptic[(Integer A)] Equal to False
Then - Actions
Set Encrypt[(Integer A)] = (Substring(Code[CodeSet], (Integer B), (Integer B)))
Set IsCryptic[(Integer A)] = True
Else - Actions
Set SaveCode[PlayerNum] = (Encrypt[1] + (Encrypt[2] + (Encrypt[3] + (Encrypt[4] + (Encrypt[5] + (Encrypt[6] + (Encrypt[7] + (Encrypt[8] + (Encrypt[9] + (Encrypt[10] + (Encrypt[11] + (Encrypt[12] + (Encrypt[13] + (Encrypt[14] + (Encrypt[15] + (Encrypt[16] + (Encrypt[17] + (Encrypt[18]
Game - Display to (Player(PlayerNum)), at offset (0.00, 0.00) for 600.00 seconds the text: (String(SaveCode[PlayerNum]) as Upper case)
Now to Decrypt it, we do the same thing, but backwards! it should look like this:
Code:
Load
Events
Player - Player 1 (Red) types a chat message containing -load as A substring
Player - Player 2 (Blue) types a chat message containing -load as A substring
Player - Player 3 (Teal) types a chat message containing -load as A substring
Player - Player 4 (Purple) types a chat message containing -load as A substring
Player - Player 5 (Yellow) types a chat message containing -load as A substring
Player - Player 6 (Orange) types a chat message containing -load as A substring
Player - Player 7 (Green) types a chat message containing -load as A substring
Player - Player 8 (Pink) types a chat message containing -load as A substring
Player - Player 9 (Gray) types a chat message containing -load as A substring
Player - Player 10 (Light Blue) types a chat message containing -load as A substring
Player - Player 11 (Dark Green) types a chat message containing -load as A substring
Player - Player 12 (Brown) types a chat message containing -load as A substring
Conditions
Actions
Set PlayerNum = (Player number of (Triggering player))
For each (Integer A) from 1 to 20, do (Actions)
Loop - Actions
Set Encrypt[(Integer A)] = <Empty String>
Set IsCryptic[(Integer A)] = False
Set CodeSet = 0
Set SaveCode[PlayerNum] = <Empty String>
Set SaveCode[PlayerNum] = (Substring((String((Entered chat string)) as Lower case), 7, (Length of (Entered chat string))))
Set CodeSet = (Integer((Substring(SaveCode[PlayerNum], 1, 1))))
For each (Integer A) from 1 to (Length of SaveCode[PlayerNum]), do (Actions)
Loop - Actions
Set Encrypt[(Integer A)] = (Substring(SaveCode[PlayerNum], (Integer A), (Integer A)))
For each (Integer A) from 2 to (Length of SaveCode[PlayerNum]), do (Actions)
Loop - Actions
For each (Integer B) from 0 to 68, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Encrypt[(Integer A)] Equal to (Substring(Code[CodeSet], (Integer B), (Integer B)))
IsCryptic[(Integer A)] Equal to False
Then - Actions
Set Encrypt[(Integer A)] = (Substring(Code[0], (Integer B), (Integer B)))
Set IsCryptic[(Integer A)] = True
Else - Actions
Set SaveCode[PlayerNum] = (Encrypt[1] + (Encrypt[2] + (Encrypt[3] + (Encrypt[4] + (Encrypt[5] + (Encrypt[6] + (Encrypt[7] + (Encrypt[8] + (Encrypt[9] + (Encrypt[10] + (Encrypt[11] + (Encrypt[12] + (Encrypt[13] + (Encrypt[14] + (Encrypt[15] + (Encrypt[16] + (Encrypt[17] + (Encrypt[18]
Now we have the unencrypted code set up, but instead of showing it to the player, we will check the player's name and if it's right set his points to the saved value. make the If - Then - Else , and in the conditions make an action to check if the first 3 letters (substring 1,3) of the players name are the same as the letters that were saved(substring 2,4). In the then actions set the variable score to equal the number in the code (substring 5,(string length). And finnaly in the else actions display a message that tells the player his code was invalid, or if you want tell everyone he was trying to steal a code

) now the load should look like this:
Code:
Load
Events
Player - Player 1 (Red) types a chat message containing -load as A substring
Player - Player 2 (Blue) types a chat message containing -load as A substring
Player - Player 3 (Teal) types a chat message containing -load as A substring
Player - Player 4 (Purple) types a chat message containing -load as A substring
Player - Player 5 (Yellow) types a chat message containing -load as A substring
Player - Player 6 (Orange) types a chat message containing -load as A substring
Player - Player 7 (Green) types a chat message containing -load as A substring
Player - Player 8 (Pink) types a chat message containing -load as A substring
Player - Player 9 (Gray) types a chat message containing -load as A substring
Player - Player 10 (Light Blue) types a chat message containing -load as A substring
Player - Player 11 (Dark Green) types a chat message containing -load as A substring
Player - Player 12 (Brown) types a chat message containing -load as A substring
Conditions
Actions
Set PlayerNum = (Player number of (Triggering player))
For each (Integer A) from 1 to 20, do (Actions)
Loop - Actions
Set Encrypt[(Integer A)] = <Empty String>
Set IsCryptic[(Integer A)] = False
Set CodeSet = 0
Set SaveCode[PlayerNum] = <Empty String>
Set SaveCode[PlayerNum] = (Substring((String((Entered chat string)) as Lower case), 7, (Length of (Entered chat string))))
Set CodeSet = (Integer((Substring(SaveCode[PlayerNum], 1, 1))))
For each (Integer A) from 1 to (Length of SaveCode[PlayerNum]), do (Actions)
Loop - Actions
Set Encrypt[(Integer A)] = (Substring(SaveCode[PlayerNum], (Integer A), (Integer A)))
For each (Integer A) from 2 to (Length of SaveCode[PlayerNum]), do (Actions)
Loop - Actions
For each (Integer B) from 0 to 68, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Encrypt[(Integer A)] Equal to (Substring(Code[[B]CodeSet[/B]], (Integer B), (Integer B)))
IsCryptic[(Integer A)] Equal to False
Then - Actions
Set Encrypt[(Integer A)] = (Substring(Code[0], (Integer B), (Integer B)))
Set IsCryptic[(Integer A)] = True
Else - Actions
Set SaveCode[PlayerNum] = (Encrypt[1] + (Encrypt[2] + (Encrypt[3] + (Encrypt[4] + (Encrypt[5] + (Encrypt[6] + (Encrypt[7] + (Encrypt[8] + (Encrypt[9] + (Encrypt[10] + (Encrypt[11] + (Encrypt[12] + (Encrypt[13] + (Encrypt[14] + (Encrypt[15] + (Encrypt[16] + (Encrypt[17] + (Encrypt[18]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((String((Name of (Player(PlayerNum)))) as Lower case), 1, 3)) Equal to (Substring(SaveCode[PlayerNum], 2, 4))
Then - Actions
Set Score = (Integer((Substring(SaveCode[PlayerNum], 5, (Length of SaveCode[PlayerNum])))))
Else - Actions
Game - Display to (Player group((Player(PlayerNum)))) the text: Invalid Code
If theres a part I should go over more clearly, please say as i may submit this to the tutorial thread.