Hello, i am making this gui that has a selector that changes it's rotation based on the mouse position (I did not make that script, the person i am working with made that.)
I am trying to script it so that the mouse position is at the middle of the screen.
This is my current script:
local mouse = plr:GetMouse()
InputService.InputBegan:Connect(function(key, chat)
if chat then return end
if key.KeyCode == Enum.KeyCode.T then
mouse.X = 0
mouse.Y = 0
end
end)
However, whenever i test the script out the log says says that it can't set the value
I don't want the mouse locked in the middle, i just want the mouse to be moved to the middle of the screen, it is free to move after that.
Any help is appreciated, thanks.

1 comment
or you can do mouse.Move:connect(function()