M MY Multiplayer: Wiki
Lado
Tipo

getElementAttachedOffsets

Compartilhado

Lê o deslocamento, a rotação e o socket com que um elemento está anexado.

float getElementAttachedOffsets(element element)

Parâmetros

NomeTipoDescrição
elementelementO elemento anexado.

Retorno

Sete valores: x, y, z do deslocamento, rx, ry, rz da rotação e o socket (o nome ou o número usado, ou nil se o elemento segue a raiz do alvo).

A função não confere se o elemento está anexado: ela devolve os valores que o elemento guarda.

Exemplo

addCommandHandler("subir", function(player)
    if not isElementAttached(player) then
        return
    end
    local x, y, z, rx, ry, rz, socket = getElementAttachedOffsets(player)
    setElementAttachedOffsets(player, x, y, z + 0.5, rx, ry, rz, socket)
end)

Veja também