Oracle
Using the Oracle SDK
Overview
The Oracle SDK provides a simple key validation and script loading system for custom key checking.
Installation
Load the SDK using HttpGet at the top of your script:
local sdk = loadstring(game:HttpGet("https://oracle.soteria.rip/sdk.lua"))()Configuration
Before checking a key, set your Script ID: this identifies which script the key belongs to:
sdk.script_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Key Validation
Use sdk.check_key(key) to validate a license key. It returns a status object with the following fields:
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the key is valid |
| error | string | Error message (if invalid) |
| code | string | Status code (see Status Codes) |
| message | string | Success message (if valid) |
| usages | number | Number of times the key has been used (if valid) |
| premium | boolean | Whether the key is a premium key (if valid) |
| discordId | string | Discord ID linked to the key, if any (if valid) |
Status Codes
The code field on the status object lets you handle specific outcomes precisely:
| Code | Description |
|---|---|
| KEY_VALID | The key is valid and active |
| KEY_INVALID | The key does not exist or does not match this script |
| KEY_EXPIRED | The key exists but has passed its expiry date |
| RATE_LIMITED | Too many validation attempts, try again shortly |
| MISSING_KEY | No key was provided in the request |
| MISSING_SCRIPT_ID | No script ID was set before calling check_key |
Loading Your Script
If the key is valid, call sdk.load_script() to load and execute your script. It wraps the fetch and execution in a pcall, so it returns the same values a pcall does: a boolean indicating success, followed by either the script's return value or an error message if it failed.
local key = "your-key-here"
sdk.script_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
local status = sdk.check_key(key)
if status.valid then
print(status.message, status.usages, status.premium, status.discordId)
script_key = key
local ok, err = sdk.load_script()
if ok then
print("Finished Loading!")
else
print("Failed to load script:", err)
end
else
print(status.error)
endError Handling
Use status.code to handle specific failure cases. If the key is invalid, call sdk.get_gate_key() to get the script's key system link:
if status.code == "KEY_INVALID" then
setclipboard(sdk.get_gate_link())
elseif status.code == "KEY_EXPIRED" then
-- handle expired key
elseif status.code == "RATE_LIMITED" then
-- handle rate limit
endFull Example
local sdk = loadstring(game:HttpGet("https://oracle.soteria.rip/sdk.lua"))()
local key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
sdk.script_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
local status = sdk.check_key(key)
if status.valid then
print(status.message, status.usages, status.premium, status.discordId)
script_key = key
local ok, err = sdk.load_script()
if ok then
print("Finished Loading!")
else
print("Failed to load script:", err)
end
else
print(status.error)
if status.code == "KEY_INVALID" then
setclipboard(sdk.get_gate_link())
end
end
