Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nnaridz/RbxGenie/llms.txt

Use this file to discover all available pages before exploring further.

Description

Sets a property value by evaluating a Lua expression that has access to the current property value. This is useful for transformations, calculations, or conditional updates based on the existing value.

HTTP Endpoint

POST /tools/set_calculated_property

Parameters

path
string
required
The path to the instance (e.g., “game.Workspace.Part”)
property
string
required
The name of the property to set
expression
string
required
A Lua expression that will be evaluated. The current property value is available as current. The result of the expression becomes the new value.

Response

ok
boolean
Returns true if the property was successfully set
newValue
any
The new value that was set, serialized to JSON format
error
string
Error message if the operation failed (path not found, property doesn’t exist, expression error, etc.)

Code Examples

Double a numeric value

{
  "path": "game.Workspace.Part",
  "property": "Transparency",
  "expression": "current * 2"
}

Increment a number

{
  "path": "game.Workspace.Counter",
  "property": "Value",
  "expression": "current + 1"
}

Conditional transformation

{
  "path": "game.Workspace.Part",
  "property": "Transparency",
  "expression": "current > 0.5 and 1 or 0"
}

String manipulation

{
  "path": "game.Workspace.Part",
  "property": "Name",
  "expression": "current .. '_copy'"
}

Math operations

{
  "path": "game.Workspace.Part",
  "property": "Size",
  "expression": "Vector3.new(current.X * 2, current.Y, current.Z * 2)"
}

Clamp a value

{
  "path": "game.Workspace.Part",
  "property": "Transparency",
  "expression": "math.clamp(current + 0.1, 0, 1)"
}

Example Response

Success

{
  "ok": true,
  "newValue": 0.8
}

Expression error

{
  "error": "Expression error: [string \"return current *\"]:1: unexpected symbol near '<eof>'"
}

Evaluation error

{
  "error": "Evaluation error: attempt to perform arithmetic on a string value"
}

Notes

  • The expression must be a valid Lua expression that returns a value
  • The current property value is available as the current variable
  • You have access to standard Lua functions like math.clamp, math.min, math.max, etc.
  • You can construct new Roblox data types like Vector3.new(), Color3.new(), etc.
  • The expression is evaluated in a sandboxed environment for security