local UserInputService = game:GetService("UserInputService")
--
-- Handle mouse button
--
local function onInputBegan(input, gameProcessed)
if gameProcessed then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
UserInputService:GetMouseLocation() -- this is the screen position (x, y)
end
end
--
-- Handle touch screen
--
local function onTouchEnded(touch, processedByUI)
if processedByUI then return end
touch.Position -- this is the screen position (x, y)
end
UserInputService.TouchEnded:Connect(onTouchEnded)
UserInputService.InputBegan:Connect(onInputBegan)