ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getRootElement

Function

getRootElement

Returns the root of the element tree: every server element is its child. The same as the root variable. Events attached to it come from every element.

Syntax

element getRootElement()

Differences from MTA:SA

  • In MTA:SA this function is client-side only.

In MTA:SA

getRootElement()

Returns

The root.

Example

addEventHandler("onPlayerJoin", getRootElement(), function()
    outputChatBox(getPlayerName(source) .. " dołączył.", root)
end)

See also