Let me introduce you briefly.
Players can create their bank account by typing a password, choosing a security question and choosing the answer.
They can sign in with their password or if they don't remember, they can reset it, but only if they have the answer to their security questions.
They can also change their data.
If the player fails to pass his password 5 times while logging in or answers the security question, he cannot login or reset his password for 2 hours.
First you need to add these functions and variables to your questlib.lua file:
The next step is to create a folder named bank or whatever you want the name, but you have to type the path of this folder in bank_path . All information about the player's bank account will be saved in this folder. (Things like bank password, security question, answer to security question and finally saved gold). And now the task: (I will indicate the places you need to edit )
Players can create their bank account by typing a password, choosing a security question and choosing the answer.
They can sign in with their password or if they don't remember, they can reset it, but only if they have the answer to their security questions.
They can also change their data.
If the player fails to pass his password 5 times while logging in or answers the security question, he cannot login or reset his password for 2 hours.
First you need to add these functions and variables to your questlib.lua file:
Code:
bank_path = '/game/bank'
function readline(path, x)
local linetable = {}
for line in io.lines(path..'/'..pc.name) do
table.insert(linetable, line)
end
return linetable[x]
end
function write_in_file(path, text)
if string.find(text, "%[ENTER%]") then
text = string.gsub(text, "%[ENTER%]", "n")
end
local file = io.open(path..'/'..pc.name, 'w')
file:write(text)
file:close()
end