M MY Multiplayer: Wiki
Side
Kind

dxDrawLine3D

Client

Draws a line in the 3D world for one frame. The line faces the camera.

bool dxDrawLine3D(float startX, startY, startZ, float endX, endY, endZ [, color color = tocolor(255, 255, 255), float width = 1, string|bool stage = postfx])

Parameters

NameTypeDescription
startX, startY, startZfloatStart point in the world. A vec3 also works.
endX, endY, endZfloatEnd point in the world. A vec3 also works.
colorcolorColour, a tocolor value.default tocolor(255, 255, 255)
widthfloatThickness.default 1
stagestring|boolWhen to draw: prefx, postfx or postgui, or a boolean (true means postgui).default postfx

Returns

true once the drawing is queued.

Example

addEventHandler("onClientRender", root, function()
    local pos = getElementPosition(localPlayer)
    dxDrawLine3D(pos.x, pos.y, pos.z, pos.x, pos.y, pos.z + 3, tocolor(255, 0, 0), 4)
end)
Noteprefx and postfx draw the same way: only postgui changes the layer.

See also