xhookLua
Game

net

Read-only usermsg hooks delivered to on_net_message(msg); game handlers still run.

Functions

net.hook_message

net.hook_message(name) -> boolean
NameTypeDescription
namestringUsermsg name, like "DeathMsg".

Routes this message to on_net_message; scripts share hooks.

Returns false if no such message

  • Case-sensitive; raises on 32+ character names or past 256 hooks.
  • on_net_message gets other scripts' hooks too, so check msg:name().

net.unhook_message

net.unhook_message(name)
NameTypeDescription
namestringName passed to hook_message.

Stops this script listening to the message.

Does nothing if never hooked.

net ยท Lua API ยท xhook