s.imagehost.lua

This file controls where license avatar photos are hosted. When a player picks up a license the script captures their portrait in-game; this file decides where that image is uploaded and stored so it can be shown on the license and in profiles.

Looking for the step-by-step webhook setup with screenshots? See ๐Ÿ–ผ๏ธ Avatar Photo Hosting.

AvatarUpload

Lua
Config.AvatarUpload = {
    -- "webhook" | "custom"
    provider = "webhook",
 
    -- Webhook URL (Discord format). Use an https://uploadhub.gg webhook so the
    -- links never expire. Only used when provider = "webhook".
    webhook = "",
}
  • Description: Chooses how captured license photos are hosted.
  • provider: Hosting path.
    • "webhook" (default) โ€” upload the photo to the Discord-format webhook URL below.
    • "custom" โ€” host the photo yourself via the UploadAvatarImage hook (see below). Any value other than "webhook" routes here.
  • webhook: Discord-format webhook URL used when provider = "webhook". Do not use a raw Discord webhook โ€” its links expire and photos will break. Use an uploadhub.gg webhook instead. Leave "" to disable webhook hosting.

Keep the webhook URL server-side only โ€” this file is a server config (s.*.lua) and is never sent to clients.


UploadAvatarImage (custom host)

Lua
function UploadAvatarImage(source, base64, format, resolve)
    -- Upload the image wherever you like, then call resolve(publicUrl) with the
    -- public URL โ€” or resolve(nil) if it failed. The upload can be async.
    resolve(nil)
end
  • Description: Server-side hook used when provider = "custom" (or any non-"webhook" provider). Upload the captured image to your own host, then hand its public URL back through resolve. The upload may be async โ€” call resolve() whenever you're done.
  • source: Server id of the player the photo belongs to.
  • base64: Raw base64 image data (no data: prefix).
  • format: Image format/extension โ€” "jpg", "png", or "webp".
  • resolve: fun(url: string|nil) callback โ€” pass the hosted public URL, or nil on failure.

The file ships with a commented Imgur example showing the exact shape of a custom uploader. Adapt it (or swap in S3, your own CDN, etc.) and return the public URL via resolve().