Skip to content

tw.text3d

Side: Client

Floating 3D text rendered in the world. Must be called every frame to remain visible.

Functions

tw.text3d.draw(options)

Draws floating text at the given world coordinates for the current frame.

ParameterTypeDescription
optionstableDrawing options (see below)

Options:

FieldTypeDefaultDescription
xnumberWorld X coordinate
ynumberWorld Y coordinate
znumberWorld Z coordinate
textstringText to display
scalenumber?0.30Text scale
background_alphainteger?180Background opacity (0-255)

The text is rendered with a black background and white text, offset +0.5 in Z from the given coordinates.

Examples

Display text in a loop

lua
CreateThread(function()
    while true do
        Wait(0)

        tw.text3d.draw({
            x = -301.62,
            y = 783.04,
            z = 117.75,
            text = "Press E to interact",
        })
    end
end)

Custom scale and transparency

lua
CreateThread(function()
    while near_target do
        Wait(0)

        tw.text3d.draw({
            x = coords.x,
            y = coords.y,
            z = coords.z,
            text = "General Store",
            scale = 0.45,
            background_alpha = 120,
        })
    end
end)

Notes

  • draw() renders text for one frame only. Call it inside a while true loop with Wait(0) to keep it visible.
  • The Z position is automatically offset by +0.5 so the text floats above the given coordinates.
  • Best used for interaction hints near objects or NPCs.

Premium RedM Scripts — Multi-Framework