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

How to get mouse without using a tool

Asked by
blowup999 659 Moderation Voter
10 years ago

Is it possible to find a mouses position without a tool? I know with a tool you can do mouse.hit.p or mouse.Target

0
You need to title your question appropriately. "Mouse" is not a question. "How do I get the mouse without using a tool?" is a question, and that should be the title. User#11893 186 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

The Player object has a GetMouse method, which returns the PlayerMouse. However, you can only use this in a Local Script.

To answer your question specifically, the following code can be used:

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

local position = mouse.hit.p
Ad

Answer this question