Skip to main content

Luau Key check library

info

This library is for Luau only, it will not work in regular Lua
Due to this library not needing any form of api key only basic information about the key is returned

warning

You do NOT need to check users keys yourself, LuaAuth protected scripts already have a whitelist built into them

tip

This library is completely safe to use in open source code as nothing private has to be given to the library to use it

What is this useful for?

If you want to check a users whitelist status in advance (check out our init macro for an easy way to do that)
Checking in advance allows you to make a enter key ui, load different scripts depending on if their whitelisted or not, etc

Library url

https://api.luaauth.com/luaulibrary

You can loadstring this url to use the library

local library = loadstring(game:HttpGet('https://api.luaauth.com/luaulibrary'))()

Setup

All you need to give to the library for setup is your scripts id, which you can find in your projects tab
All you do is:

library.script_id = 'SCRIPT_ID'

Commands

check_key

syntax: library.check_key(key: string)

key is just the key to check

Return data

{
status = 'key_valid',
user = {
key_expires = nil, -- nil if infinite, otherwise unix timestamp in seconds of expire
executions = 0,
fingerprint_assigned = true,
note = 'NOTE',
ad_key = false
}
}

load_script

syntax: library.load_script(key: string)

loads the script from the id you set using library.script_id
key is the users key to load script with

Example code

local uiLib = loadstring(...)()

local library = loadstring(game:HttpGet('https://api.luaauth.com/luaulibrary'))()
library.script_id = 'SCRIPT_ID'

local con
con = uiLib.onSubmit:Connect(function(key)
if key == '' then return end
local result = library.check_key(key)

if result.status == 'key_valid' then
con:Disconnect()
uiLib:removeKeyMenu()

library.load_script(key)
elseif result.status == 'key_blacklisted' then
game:GetService('Players').LocalPlayer:Kick('You are blacklisted for ' .. result.user.blacklist_reason)
elseif result.status == 'invalid_key' then
uiLib:showText('invalid key provided, please enter a new one')
elseif result.status == 'invalid_fingerprint' then
uiLib:showText('key is linked to another fingerprint, please reset your fingerprint then try again')
elseif result.status == 'key_expired' then
uiLib:showText('provided key has expired, buy a new one at .gg/example')
elseif result.status == 'invalid_script_id' then
uiLib:showText('an unknwn error occured, report to example devs at .gg/example')
end
end)