SlashCo Wiki

SlashCo.ReadOptional

  SlashCo.ReadOptional( function readFunc, any optionalArgs )

Description

It's useless to use this function on a boolean / when using net.WriteBool as this will only add overhead.
Unless you want to preserve nil values.

Helper networking function that only writes a value if it isn't nil
The sender code must use SlashCo.WriteOptional
You can find a example on SlashCo.WriteOptional

Arguments

1function readFunc
2any optionalArgs

Any amount of additional arguments