Create3DText
create3DText
Creates a server-authoritative world-space text label and replicates it to connected players.
Syntax
string|false create3DText(string text, number x, number y, number z [, table options])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text |
string |
yes | Valid UTF-8 text containing 1-128 characters and at most 256 bytes. |
x |
number |
yes | World X coordinate in metres. |
y |
number |
yes | World Y coordinate in metres. |
z |
number |
yes | World Z coordinate in metres. |
options |
table |
no | Optional fields: drawDistance (1-1000 metres), scale (0.25-5.0), and integer r, g, b, a color channels (0-255). |
Returns
Returns an opaque text identifier string on success, or false when validation or capacity limits reject the request.
Examples
Create a gold world label above an RP meeting point:
local meetingLabel = create3DText(
"Old Camp meeting point",
125.0, -48.5, 3.2,
{
drawDistance = 40.0,
scale = 0.85,
r = 225, g = 185, b = 91, a = 255
}
)
if not meetingLabel then
outputDebugString("Could not create the meeting label", 1)
end
Notes
- Available only in server-side resource scripts.
- The server replicates creation and updates reliably, including the current state for late-joining players.
- The creating resource owns the label. Other resources cannot change or destroy it, and it is removed automatically when its owner stops.
- A resource may own up to 1024 labels, with a server-wide maximum of 8192 labels.
- Store the returned identifier as a string. Do not convert it to a Lua number.
- Expanded limits apply from update 0.1.3 BUILD81. See Scripting limits; earlier 0.1.3 binaries retain their old limits.