Roblox Script - rconsole key system

 

Recommend to have a basic understanding of Lua before using this and be aware this is not very secure and can be bypassed very easily.



Script:
key = "Secret"


function getKey()
rconsoleprint("Enter key: ")
  local key = rconsoleinput()
  return key
end


function checkKey(enteredKey)
  local correctKey = key
  if enteredKey == correctKey then
    return true
  else
    return false
  end
end


while true do
  local key = getKey()
  if checkKey(key) then
    rconsoleprint("Correct key!\n")
    break
  else
    rconsoleprint("Incorrect key, please try again.\n")
  end
end


 

Previous Post Next Post