mousemoverel
Moves the mouse cursor relative to its current position.
Syntax
mousemoverel(dx: number, dy: number) -> voidParameters
| Parameter | Type | Description |
|---|---|---|
dx | number | Horizontal offset in pixels |
dy | number | Vertical 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)
endRelated Functions
mousemoveabs- Move to absolute position