Hello,
UserInputService.InputBegan:connect(function(input, gameProcessedEvent) if input.UserInputType == Enum.UserInputType.MouseButton1 then
I am trying to write if the mouse has clicked a button called ("button1") then but I am unsure on how to write it in terms of lua.
Use MouseButton1Click
when trying to detect left-click on a GUI. Use MouseButton2Click
when trying to detect right-click on a GUI.
For example:
--For local script under a TextButton. script.Parent.MouseButton1Click:Connect(function() print("Parent was clicked.") end)