M MY Multiplayer: Wiki
Side
Kind

onClientDebugMessage

ClientEventCancellable

Fired on this client for every script line that goes to the log: errors, warnings and messages.

addEventHandler("onClientDebugMessage", root, function(string message, int level, string|nil file, int|nil line) … end)

Handler parameters

NameTypeDescription
messagestringThe line's text.
levelint1 error, 2 warning, 3 message (from outputDebugString with another level, print or outputServerLog).
filestring|nilThe file the line came from, or the resource's name. nil for messages.
lineint|nilThe line in the file. nil when unknown.

Source

The root element (root).

Cancelling the event keeps the line from being written. What a handler of this event writes does not fire the event again.

Example

addEventHandler("onClientDebugMessage", root, function(message, level, file, line)
    if level == 1 then
        triggerServerEvent("onClientScriptError", resourceRoot, message, file, line)
    end
end)

See also