I am making a very simple (and probably hackable) login system for my single player world. Not that I need it but hey, the more programming a person does the better they get at it. I am trying to use a simple system where a serialized table with usernames and hashed passwords is stored to a file and the login system then unserializes that table and checks the input-ed username and password against that table. But I seem to be having a problem saving the table in the first place. In my code I have set the variable userName to "Happydude11209" and set passwordHash to "xLerx{N7,Ujty:N7>?_@0($" after hashing "password". But then I get an error with the following piece of code.
-- EditUsers lines 98 to 100 print(userName) print(passwordHash) passwordTable[userName] = passwordHash -- line 100That code gives the following output:
Happydude11209 xLerx{N7,Ujty:N7>?_@0($ EditUsers:100: index expected, got nilAm I doing anything wrong or can I not set string index table entries using a variable to represent the index?
Regards,
Happydude11209