Garry's Mod Wiki

net.BytesLeft

  number, number net.BytesLeft()

Description

Returns the amount of data left to read in the current message. Does nothing when sending data.

This will include 6 extra bits (or 1 byte rounded-up) used by the engine internally.

Returns

1 number
The amount of data left to read in the current net message in bytes. Returns nil if no net message has been started.
2 number
The amount of data left to read in the current net message in bits. Returns nil if no net message has been started.