Posted 29 October 2016 - 07:10 AM
Ok so I would first like to say I am a beginner at lua so I might make some mistakes here is the code:
Choose a username: /username/
Verifying account…
Making account with the username: /username/
Now enter the PIN you want: 1111
/username/
Now enter the PIN you want:
It keeps on looping any ideas??
EDIT : It only loops 5 times as noacc (meaning number of accounts) is 5 I agree that I misplaced an end it must be around here somewhere
else -- Create an account
reset(colors.black, 1, 1)
write("Choose a username : ")
newuser = read()
print("Verifying account...")
randsleep(2, 5)
for i = 1, noacc do
if newuser == accounts[i] then
error("Account already exists")
end
print("Making account with the username: "..newuser)
write("Now enter the PIN you want : ")
newpin = read()
for i = 1, noacc do -- Gos through list of pins of username to verify account
if newpin == pins[i] then
pinverify = true
else i = i + 1 end
end
noacc = noacc + 1
accounts[noacc] = newuser
pins[noacc] = newpin
print(accounts[noacc])
end
end
Near the last bit it loops. It keeps saying:Choose a username: /username/
Verifying account…
Making account with the username: /username/
Now enter the PIN you want: 1111
/username/
Now enter the PIN you want:
It keeps on looping any ideas??
EDIT : It only loops 5 times as noacc (meaning number of accounts) is 5 I agree that I misplaced an end it must be around here somewhere
Edited on 29 October 2016 - 09:48 PM