I'm trying to figure out how to find the direction the mouse is moving, and eventually narrow it down to just four options; if the mouse is going up, going left, going right, or going down. Anyone have any ideas on how this might be possible?
The easiest way to do this is like so,
-- This is in a LocalScript wait(); local player = game.Players.LocalPlayer; -- Sets player to be the localplayer local mouse = player:GetMouse(); -- Sets mouse as the players mouse while player.Character:FindFirstChild("Humanoid").Health > 0 do -- Just a check to see if the player is alive print("Mouse X: "..mouse.X..", Y: "..mouse.Y); -- mouse.X and mouse.Y return the position on screen that the mouses cursor is pointing at wait(0.5); -- Just a wait so it's not constantly printing it out. end;
This script will print out the mouses location on screen every half a second. Here is a link to the wiki article for the Mouse class. Hope this helps!