---
description: Enter a code using a digital number pad.
---

# Keypad

<figure><img src="https://3546595727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoRne7ThJaBZiwCpSKT7V%2Fuploads%2FqdfAPjlmckeOydj6WEFF%2Fkeypad.png?alt=media&#x26;token=fbc1b20f-229d-4c75-a007-0bb08ce43c32" alt=""><figcaption></figcaption></figure>

```lua
-- Keypad Lock
RegisterCommand('testkeypad', function()
    local correctCode = "A1B2C3" -- Alphanumeric code
    exports['moon-ui']:OpenKeypadLock(correctCode, function(success)
        if success then
            print('Code correct! Access granted.')
            -- Add your logic here for successful code entry
        else
            print('Code incorrect! Access denied.')
            -- Add your logic here for failed code entry
        end
    end)
end)

```

