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

Is there an Event when mouse goes off screen?

Asked by
Bertox 159
8 years ago

When the mouse goes off the screen

1 answer

Log in to vote
2
Answered by
rexbit 707 Moderation Voter
8 years ago

There is not, sadly. But there are properties of mouse titled X and Y, both represent positions of the mouse, both have contrary positioning purposes.

local m=game.Players.LocalPlayer:GetMouse()

while m and wait() do
    if m.X < 1 or m.Y < 1 then
        print('nope')
    end
end

This checks if the mouse is considered an outsider to the screen displayed.

Ad

Answer this question