So basically I am making a puzzle game and I am trying to script a cipher the cipher I am using is the a1z26 so basically a = 1 b = 2 c = 3 d = 4 ... z = 26 and yeah I have the code set up but I don't know how to convert the text into numbers I have the tables set up and yeah here is the script
AlphabetTbl = {}
Alphabet = "abcdefghijklmnopqrstuvwyxABCDEFGHIJKLMNOPQRSTUVWXYZ "
for i = 0,#Alphabet,1 do
AlphabetTbl[i] = string.sub(Alphabet, i, i)
end
function encrypt(txt)
for i = 0,#txt, 1 do
print()
end
end
So yeah the alphabet table is going to be every letter seperated so then I can reference it like AlphabetTbl[1] for substitution but I do not know how to find the letters in the text and turn them into a number so if it was a it would be one because AlphabetTbl[1] = "a" and so on and I am very confused and need help.

2 comments
Do you mean the printed thing is like 'a = 1, b = 2' of an example?
No I want the encrypt function to turn a string like "abcdefghijklmnopqrstuvwxyz" to 123456789 and so on but I can add the serpator I just need help with the conversion