> For the complete documentation index, see [llms.txt](https://moon-store.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://moon-store.gitbook.io/docs/moon-ui/minigames/image-lock.md).

# Image Lock

View an image and optionally enter a password to unlock.

<figure><img src="https://3546595727-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoRne7ThJaBZiwCpSKT7V%2Fuploads%2FLZxhuMiaZhHFdek2ptzO%2Fimagelock.png?alt=media&amp;token=3788b417-c5f1-4373-a10d-346a10984efe" alt=""><figcaption></figcaption></figure>

```lua
-- Display Image
RegisterCommand('testimage', function()
    local imageUrl = "https://images.pexels.com/photos/3052361/pexels-photo-3052361.jpeg" -- Example Pexels image
    exports['moon-ui']:OpenImage(imageUrl, function(success)
        if success then
            
            print('Image opened successfully.')
        else
            print('Failed to open image.')
        end
    end, "1234") -- Pass nil instead of "1234" for no password protection
end)
```
