Volt

mousemoverel

Moves the mouse cursor relative to its current position.

Syntax

mousemoverel(dx: number, dy: number) -> void

Parameters

ParameterTypeDescription
dxnumberHorizontal offset in pixels
dynumberVertical offset in pixels

Returns

This function does not return a value.

Description

mousemoverel moves the mouse cursor by the specified amount relative to its current position.

Example

-- Move right 100 pixels
mousemoverel(100, 0)

-- Move down 50 pixels
mousemoverel(0, 50)

-- Move diagonally
mousemoverel(50, 50)

Circle Motion

-- Draw a circle with mouse movement
for i = 0, 360, 5 do
    local rad = math.rad(i)
    local dx = math.cos(rad) * 2
    local dy = math.sin(rad) * 2
    mousemoverel(dx, dy)
    task.wait(0.01)
end

On this page