Posted 18 July 2014 - 05:16 AM
Ok here's my problem… In my base i wanted to set up like restrictions on the doors. The owner(me) when i type in the user name and password it opens all doors. The admin(a server member) when he types in his code it only opens certain doors and so on with the guest.
"This is how the code looks to the "t". I tried spacing it out but it wont post right and tbh i dont know how it should be spaced…This is the error i was getting: bios:366: [starting "startup" : 57: 'end' expected (to close 'if' at line 17)
local admin = "Cabalee"
local adminpass = "music"
local guest = "Footykaiser11"
local guestpass = "bigfoot"
while true do rs.setOutput("left", false)
rs.setOutput("right", false)
rs.setOutput("back", false)
term.clear()
term.setCursorPos(1,1)
write("Please enter your username: ")
local name = read()
if name == owner then
term.clear()
term.setCursorPos(1,1)
write("Please enter password: ")
local pass = read("*")
if pass == ownerpass then
rs.setOutput("left", true)
rs.setOutput("right", true)
rs.setOutput("back", true)
term.clear()
term.setCursorPos(1,1)
print("Access Granted. All rights have been invoked. Welcome back Soviet!")
sleep(10)
elseif name == admin then
term.clear()
term.setCursorPos(1,1)
write("Please enter password: ")
local pass = read("*")
if pass == adminpass then
rs.setOutput("left",true)
rs.serOutput("right", ture)
term.clear()
term.setCursorPos(1,1)
print("Access Granted. Access level medium. Welcome back Cabalee!")
sleep(10)
elseif name == guest then
term.clear()
term.setCursorPos(1,1)
write("Please enter password: ")
local pass = read("*")
if pass == guestpass then
rs.setOutput("left",true)
term.clear()
term.setCursorPos(1,1)
print("Access Granted. Low level access. Welcome back Footykiser!")
sleep(10)
end
end
"This is how the code looks to the "t". I tried spacing it out but it wont post right and tbh i dont know how it should be spaced…This is the error i was getting: bios:366: [starting "startup" : 57: 'end' expected (to close 'if' at line 17)
local admin = "Cabalee"
local adminpass = "music"
local guest = "Footykaiser11"
local guestpass = "bigfoot"
while true do rs.setOutput("left", false)
rs.setOutput("right", false)
rs.setOutput("back", false)
term.clear()
term.setCursorPos(1,1)
write("Please enter your username: ")
local name = read()
if name == owner then
term.clear()
term.setCursorPos(1,1)
write("Please enter password: ")
local pass = read("*")
if pass == ownerpass then
rs.setOutput("left", true)
rs.setOutput("right", true)
rs.setOutput("back", true)
term.clear()
term.setCursorPos(1,1)
print("Access Granted. All rights have been invoked. Welcome back Soviet!")
sleep(10)
elseif name == admin then
term.clear()
term.setCursorPos(1,1)
write("Please enter password: ")
local pass = read("*")
if pass == adminpass then
rs.setOutput("left",true)
rs.serOutput("right", ture)
term.clear()
term.setCursorPos(1,1)
print("Access Granted. Access level medium. Welcome back Cabalee!")
sleep(10)
elseif name == guest then
term.clear()
term.setCursorPos(1,1)
write("Please enter password: ")
local pass = read("*")
if pass == guestpass then
rs.setOutput("left",true)
term.clear()
term.setCursorPos(1,1)
print("Access Granted. Low level access. Welcome back Footykiser!")
sleep(10)
end
end