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)
- The "namespace" parameter exists to allow you to have multiple containers with overlapping message names.
function light.container
(On The Server)
- The "namespace" parameter exists to allow 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()