Create3DText: Difference between revisions
Jump to navigation
Jump to search
Complete Lua function catalog |
Document expanded scripting capacities and complete audited limits for 0.1.3 BUILD81 |
||
| Line 1: | Line 1: | ||
= create3DText = | = create3DText = | ||
Creates a server-authoritative world-space text label and replicates it to connected players. | Creates a server-authoritative world-space text label and replicates it to connected players. | ||
| Line 48: | Line 47: | ||
* The server replicates creation and updates reliably, including the current state for late-joining players. | * 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. | * 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 | * 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. | * 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. | |||
[[Category:Lua Functions]] | [[Category:Lua Functions]] | ||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:World Functions]] | [[Category:World Functions]] | ||
Latest revision as of 11:51, 12 September 2026
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.