sm.message

Functions:

  • send
  • subscribe

  • sm.message.send(messageKey, data?)

    Server only

    Sends a message to all script instances registered for the given key. Can only be called from server!

    Parameters:

    TypeNameDescription
    stringmessageKeyThe message key.
    anydata?Optional data to send with the message.

    sm.message.subscribe(messageKey, callbackName)

    Server only

    Subscribes the calling script instance to receive messages for a given key. Can only be called from server!

    Parameters:

    TypeNameDescription
    stringmessageKeyThe message key to subscribe to.
    stringcallbackNameThe name of the callback function to invoke.