Containers
Containers are the recommended and easy way to group together messages in light by name.
Container inputs should be a map of string message-names to any valid Datatype.
This includes Datatypes like arrays or maps that are defined with luau tables.
I.e., { light.datatypes.u8 }
If messages inside are already synchronized beforehand, the container will not yield.
The server defines the messages immediately, so container {...}
will never yield on the server.
function light.container
(On The Client)
function light.container
(On The Server)
Namespaces don't impact behavior
Namespaces do not impact message ordering whatsoever in light. They are entirely cosmetic, allowing you to have multiple containers with overlapping message names.
Some example code using containers:
You can replicate the above code 1:1 with light.message()