Skip to main content

Exports

Overview​

FS-TextUI exposes a set of high-performance exports to create, update, and remove 3D TextUI elements.

All exports are persistent, meaning you do not need to call them inside a while true loop.

tip

FS-TextUI is designed to handle hundreds of active text points with minimal CPU and GPU usage.


createTextUI​

Creates a floating 3D text at specific world coordinates.

exports['fs-textui']:createTextUI("unique_id_here", {
text = "Press E to Interact", -- Text to display
coords = vector3(100.0, 200.0, 30.0), -- World coordinates
displayDist = 5.0, -- (Optional) Display distance
key = "E" -- (Optional) Key indicator
})
note

If the provided ID already exists, the call will be ignored to prevent duplicate entries.

updateTextUI​

Updates the text content in real time without recreating the TextUI instance.

Ideal for dynamic values such as prices, counters, or states.

exports['fs-textui']:updateTextUI("unique_id_here", "New text here")
note

This operation is extremely cheap and safe to call frequently.

deleteTextUI​

Removes a TextUI instance and clears it from memory.

exports['fs-textui']:deleteTextUI("unique_id_here")

DrawText3D (Legacy Compatibility)​

Fivesoft 3D Text UI provides a legacy-compatible DrawText3D export for older scripts.

Internally, this converts per-frame calls into a TTL-based optimized system, eliminating FPS loss.

local coords = vector3(x, y, z)
exports['fs-textui']:DrawText3D(
coords,
"Open Door",
"unique_door_id",
"E"
)

To fully support old scripts without editing every call, paste this at the top of the legacy client.lua:

function DrawText3D(x, y, z, text)
local coords = vector3(x, y, z)

-- Generates a semi-stable unique ID based on position
local id = string.format("legacy_%s_%s", math.floor(x), math.floor(y))

exports['fs-textui']:DrawText3D(coords, text, id, "E")
end
warning

The generated ID is position-based.
Avoid moving the same text point dynamically when using the global override.