Skip to content

Input

light.input() is a function which allows you to use light's internal serialization on your own DynamicWriter.

function light.internal.input

Errors Client Server Shared Experimental Synchronous
1
2
3
4
5
function input<T>(
    writer: DynamicWriter,
    type: Datatype<T>,
    data: T
): ()

You'll need to provide a valid DynamicWriter, Datatype, and some data to serialize. You can deserialize the data with Output.

Use correct data or pcall()

If the data is incorrect, this function may error.

The buffer may change

After calling light.input, the buffer the writer contains may change because it had to be resized. Do not hold onto buffers when using this API, each time you call it assume the only safe way to get the buffer directly is with light.internal.get_writer_buff().