Call any function directly with arguments and capture its result
call-closureExecute a Luau function resolved from a runtime expression with typed arguments, returning every produced value or pcall error. Invoke hidden or remote-event handlers in the live game state.
Instructions
ACTS ON LIVE GAME STATE — EXECUTES THE FUNCTION. Resolve a Luau expression to a function and CALL it with an ordered list of typed arguments, returning every value it produces. This lets you invoke internal, hidden, or anonymous functions on demand: a remote's OnClientEvent handler (getconnections(remote.OnClientEvent)[1].Function), a metamethod (getrawmetatable(game).__namecall), a member pulled from a script env (getsenv(script).someFunc), a constant/upvalue you extracted, or any closure found in the GC. Each argument is a typed value; use kind='raw' for non-primitive arguments (Vector3, Color3, Enum, CFrame, tables, Instance references, ...). The call is fully pcall-guarded, so a function that errors reports its message instead of aborting. WARNING: this genuinely runs the target function with the arguments you supply — it MAY cause side effects, mutate game state, fire remotes to the server, or trip anti-cheat. Only call functions you understand. Returns { Target, ok, returns, returnCount, truncated, argCount } on success, or { Target, ok=false, error, argCount } when the function raised. Signature: { functionPath: string, args: {{ kind: "string" | "number" | "boolean" | "nil" | "raw", value: string | number | boolean? }}?, threadContext: number? }. Phase: act; cost=medium; idempotency=contextual-write. Requires: active-client, resolved-target, explicit-mutation-approval. Capabilities: debug closure primitives. Produces: operation-receipt. Verify with: assert-state. Safety: MUTATING; executes caller-selected behavior in the live client. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Ordered list of positional arguments to pass to the function. Omit or pass [] to call it with no arguments. Each entry is a typed value; use kind='raw' for anything that isn't a plain string/number/boolean/nil. | |
| functionPath | Yes | Luau expression resolving to the function to call, e.g. 'getsenv(game.Players.LocalPlayer.PlayerScripts.Main).update', 'getrawmetatable(game).__namecall', 'getconnections(game.Workspace.Part.Touched)[1].Function', or 'getgenv().myGlobalFn'. Evaluated as `return <functionPath>`; the result must be a function. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |