core.engine.screenshot

Client

Captures a screenshot and saves it to the specified path


Syntax

local result = core.engine.screenshot(path)

Prefix the path with :resourcename to save screenshots into another running resource.

  • Local path — resolves relative to the current resource's directory.
  • Cross-resource path — prefix with :resourcename to resolve relative to another running resource's directory.
  • Example:resource_a/screenshots/capture.png saves screenshots/capture.png inside resource_a.

Parameters

TypeNameDescription
stringpathDestination file path to save the screenshot

Returns

TypeNameDescription
boolresulttrue on successful capture, false otherwise

Examples

Captures a screenshot to a fixed path
core.engine.screenshot("screenshots/capture.png")
Captures a screenshot with a timestamp tag in the filename
core.engine.screenshot("screenshots/capture_" .. core.engine.get_timestamp_tag() .. ".png")

On this page