Set the .Text of a GUI element
set-gui-textSet a Roblox TextLabel, TextButton, or TextBox .Text directly from a Luau expression, returning old and new text for auditing.
Instructions
WRITES LIVE GAME STATE. Resolve a Luau expression to a GUI Instance and overwrite its .Text property, returning both the OLD and NEW text so the change is auditable. Use this to directly poke a value into a TextLabel, TextButton or TextBox without simulating keystrokes — e.g. to pre-fill a login/search box or change a label while debugging UI logic. This sets the raw .Text directly and does NOT fire FocusLost / text-changed input events, so scripts that react only to player typing may not run; use type-text-box with useKeyPress when you need real keystroke side-effects. The read of the old text and the write are each pcall-guarded. WARNING: this mutates the running client UI immediately. Returns { Path, OldText, NewText, ok } or { error }. Signature: { path: string, text: string, threadContext: number? }. Phase: act; cost=medium; idempotency=idempotent-write. Requires: active-client, resolved-target, explicit-mutation-approval. Produces: operation-receipt. Verify with: get-gui-text. Safety: MUTATING; writes live game/client state. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Luau expression resolving to the GUI Instance whose .Text to set, e.g. 'game.Players.LocalPlayer.PlayerGui.Login.UsernameBox'. Evaluated as `return <path>`. The resolved Instance must have a writable .Text property (TextLabel / TextButton / TextBox). | |
| text | Yes | The new string to assign to the element's .Text property. Written verbatim. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |