-- Step 1: Define variables for the Mouse and the UIS
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local uis = game:GetService("UserInputService")
-- Step 2: Create a function to handle mouse movement
local function onMouseMove(x, y)
-- Add your code to handle mouse movement here
-- Example: print("Mouse moved to (" .. x .. ", " .. y .. ")")
end
-- Step 3: Connect the function to the MouseMove event
uis.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
onMouseMove(input.Position.X, input.Position.Y)
end
end)