Detecting where player clicks?

Let me get to the point, whenever the player clicks it will give me the position of where it is,
for example, i click at 15, 10, 20 it gives me that coords… How would i do that?

2 Likes

Use the mouse to do this.

--LocalScript
local Players = game:GetService("Players");
local plr = Players.LocalPlayer;
local mouse = plr:GetMouse();

mouse.Button1Down:Connect(function() --This will run whenever the player clicks
    print(mouse.Hit.Position); --mouse.Hit is the CFrame where the mouse is pointing to. We can get the Vector3 of a CFrame with the .Position property.
end)
4 Likes