part = Instance.new("Part",game.Workspace) local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.Button1Down:Connect(function() end)
You can get the mouse position by getting the MouseObject
and using Mouse.Hit.p
. There is more information on it here:
https://developer.roblox.com/api-reference/property/Mouse/Hit
To check if they left clicked, you would use Mouse.Button1Down
event. More documentation here and sample codes:
https://developer.roblox.com/api-reference/event/Mouse/Button1Down
However, I recommend using UserInputService
as it is more modern and updated. More documentation here and sample codes:
https://developer.roblox.com/api-reference/event/UserInputService/InputBegan