Electron Documentation
Exports

Media Capture

Capture visual evidence from the player's perspective.

Exports need to always be invoked on ElectronAC, even if you renamed the resource.

Taking Screenshots

Capture a screenshot of the player's screen and upload it to a specified endpoint.

exports["ElectronAC"]:screenshotPlayer(cb, url, field)

Prop

Type

Recording Player Gameplay

Record the player's screen for a specified duration and upload it to a specified endpoint.

exports["ElectronAC"]:recordPlayer(cb, url, field, duration)

Prop

Type

Example Usage

Here is an example of how to use these exports to send media to a Discord webhook.

client.lua
-- Screenshot command
RegisterCommand("screenshot", function()
   exports["ElectronAC"]:screenshotPlayer( 
      function(data)
         print("Screenshot created, URL:", data.attachments[1].url)
      end,
      "YOUR_WEBHOOK_URL",
      "files[]"
   )
end, false)

-- Recording command (5 seconds)
RegisterCommand("recording", function()
   exports["ElectronAC"]:recordPlayer( 
      function(data)
         print("Recording created, URL:", data.attachments[1].url)
      end,
      "YOUR_WEBHOOK_URL",
      "files[]",
      5000
   )
end, false)

On this page