Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I change the mouse's position?

Asked by 5 years ago

Hello! I am wondering how to set a mouse's position in-game. This is what I made but the output prints "- can't set value". Please help!

local tool = script.Parent

tool.Equipped:connect(function(mouse)
    mouse.Button1Down:connect(function()
        mouse.Y = mouse.Y + math.random(3, 7)
        mouse.X = mouse.X + math.random(2, 4)
    end
end
0
Its a local script or no? yHasteeD 1819 — 5y
0
yes 0_Halloween 166 — 5y
1
You cannot change the mouse position for security reasons User#19524 175 — 5y
0
^ You can however force the players mouse into the center with UserInputService.MouseBehavior = "LockCenter" | and then point their camera to where you want it to look at exactly. this obviously wont work for anything UI related, but it's how you for example would make an aimbot. RubenKan 3615 — 5y

Answer this question