Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- RPG SOURCE
- -- DefeatedPurpose (Tohru / Kanna)
- ver = "[BETA] 1.0"
- -- Standard wait func
- -- Setting up the wait function
- local function wait(tick)
- local tick = tick or 1
- local delay = os.time() + tick
- while os.time() < delay do end
- end
- -- Login Database
- NDatabase = {
- "Owner_Test"
- }
- PDatabase = {
- "Owner_Pass"
- }
- feedback = {
- "Bad rpg"
- }
- Logged = false
- warn = "[CASE SENSITIVE]"
- print("Welcome to an RPG!")
- wait(1)
- print("You are running version: "..ver)
- wait(1)
- print("Do you have an existing account or would you like to create a new one?")
- wait(1)
- print("Options")
- print("1. Sign In")
- print("2. Sign Up")
- wait(1)
- a = io.read()
- a = string.lower(a)
- if a == "sign in" then
- signingin = true
- signingup = false
- elseif a == "sign up" then
- signingin = false
- signingup = true
- end
- wait(1)
- if signingin then
- print("Looks like you're signing in. Glad to have you back!")
- wait(1)
- print("Username? "..warn)
- a = io.read()
- for i,v in pairs(NDatabase) do
- if a == v then
- matched = true
- else
- matched = false
- end
- end
- wait(1)
- if matched then
- print("Username found in our database.")
- else
- print("Username not found in our database.")
- end
- wait(1)
- if matched then
- print("Password? "..warn)
- a = io.read()
- for i,v in pairs(PDatabase) do
- if a == v then
- matched2 = true
- else
- matched2 = false
- end
- end
- end
- wait(1)
- if matched2 then
- print("Login Success!")
- Logged = true
- else
- print("Login Failed!")
- Logged = true
- wait(1)
- print("Please restart the login process to try again.")
- end
- end
- if signingup then
- print("Thank you for your intrest in my RPG and I hope you enjoy your time playing!")
- wait(1)
- print("To begin, please type a username!")
- a = io.read()
- for i,v in pairs(NDatabase) do
- if a == v then
- taken = true
- else
- taken = false
- end
- end
- wait(1)
- if taken then
- a = ""..a..""..math.random(231, 999)..""
- print("Name already taken!")
- print("Generated Name:")
- print(a)
- else
- print("Chosen Name:")
- print(a)
- end
- table.insert(NDatabase, a)
- wait(1)
- print("Choose a password")
- a = io.read()
- wait(1)
- if #a > 5 then
- print("Password too short!")
- wait(1)
- print("Generated Password:")
- a = ""..a, math.random(1,9), math.random(1,9), math.random(1,9), math.random(1,9)..""
- print(a)
- else
- print("Password Set.")
- end
- table.insert(PDatabase, a)
- wait(1)
- print("You may now proceed to the login stage!")
- wait(1)
- print("Username? "..warn)
- a = io.read()
- for i,v in pairs(NDatabase) do
- if a == v then
- matched = true
- else
- matched = false
- end
- end
- wait(1)
- if matched then
- print("Username found in our database.")
- else
- print("Username not found in our database.")
- end
- wait(1)
- if matched then
- print("Password? "..warn)
- a = io.read()
- for i,v in pairs(PDatabase) do
- if a == v then
- matched2 = true
- else
- matched2 = false
- end
- end
- end
- wait(1)
- if matched2 then
- print("Login Success!")
- Logged = true
- else
- print("Login Failed!")
- Logged = true
- wait(1)
- print("Please restart the login process to try again.")
- end
- end
- wait(1)
- if Logged then
- while true do
- print("Welcome to the User Interface!")
- wait(1)
- print("Options:")
- print("1. Log Out (Unsaved progress will be lost)")
- print("2. Delete Account (Can't be undone.")
- print("3. Explore [W.I.P.]")
- a = io.read()
- a = string.lower(a)
- wait(1)
- if a == "log out" then
- print("Logging out..")
- wait(3)
- Logged = false
- print("Logged out. Hope to see you back soon!")
- break
- end
- if a == "delete account" then
- print("Deleting account and all data related to it...")
- -- Not set up yet so clears database entirely
- NDatabase = nil
- PDatabase = nil
- wait(5)
- Logged = false
- print("Account has been deleted and you have been logged out, Please provide some feedback on why you have made this decision.")
- a = io.read()
- print("Thank you for your feedback.")
- table.insert(feedback, a)
- break
- end
- if a == "explore" then
- print("You explore but find nothing.")
- print("Probably because this function isn't set up yet. IDK?")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement