ByteNet Max serializes your Lua values into compact binary buffers before they travel over the network. Primitive types are the building blocks of that system — each one maps to a specific Lua or Roblox type and occupies a fixed number of bytes (or, in the case ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Elitriare/ByteNet-Max/llms.txt
Use this file to discover all available pages before exploring further.
string, a length-prefixed variable amount). Understanding which type to reach for helps you keep packets as small as possible.
Usage example
The snippet below shows the most commonly used primitive types composed together inside astruct:
Type reference
Number types
Number types
| Type | Maps to | Range | Size |
|---|---|---|---|
uint8 | number | 0 – 255 | 1 byte |
uint16 | number | 0 – 65,535 | 2 bytes |
uint32 | number | 0 – 4,294,967,295 | 4 bytes |
int8 | number | -128 – 127 | 1 byte |
int16 | number | -32,768 – 32,767 | 2 bytes |
int32 | number | -2,147,483,648 – 2,147,483,647 | 4 bytes |
float32 | number | ±3.4 × 10³⁸ (32-bit IEEE 754) | 4 bytes |
float64 | number | ±1.8 × 10³⁰⁸ (64-bit IEEE 754) | 8 bytes |
uint*) for naturally non-negative values. Use int* when the value can be negative. float32 covers almost all game-world use cases; reserve float64 for values that require higher precision.Text and miscellaneous types
Text and miscellaneous types
| Type | Maps to | Size |
|---|---|---|
string | string | 2-byte length header + N bytes for content |
bool | boolean | 1 byte (stored as uint8: 1 = true, 0 = false) |
nothing | nil | 0 bytes (no data written or read) |
unknown | unknown | Variable — falls back to reference/unknown behavior |
buff | buffer | Variable |
nothing is useful as the value type of a packet that carries no payload — it signals intent without wasting bytes. unknown and buff are rarely used directly; prefer explicit types wherever possible.Roblox types
Roblox types
| Type | Maps to | Size |
|---|---|---|
vec2 | Vector2 | 8 bytes (two float32 components) |
vec3 | Vector3 | 12 bytes (three float32 components) |
color3 | Color3 | 3 bytes (R, G, B each as uint8 in 0–255) |
cframe | CFrame | 24 bytes (position + axis-angle rotation, six float32 values) |
inst | Instance | Variable — transmitted as a reference |
cframe encodes position (X, Y, Z) and rotation as an axis-angle pair so a full transform fits in 24 bytes. color3 quantizes each channel to 8 bits, which is sufficient for all standard Roblox color values.Special alias types
Special alias types
| Type | Alias for | Maps to | Size |
|---|---|---|---|
playerName | string | string | 2-byte header + N bytes |
playerIdentifier | uint8 | number | 1 byte |
playerName and playerIdentifier are convenience aliases — they are wire-identical to string and uint8 respectively. They exist to make packet definitions more self-documenting when a field specifically represents a player’s display name or a compact per-session player ID.