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.

5 comments
You could just use a ClickDetector if your button is a part. Or get the Event MouseButton1Click or Activated if it's a GUIButton. No need to get the mouse
Yes. I was going to do it script.Parent.MouseButton1Click:connect(function() instead but I've been told that userinputservice is always better. I don't know how it could work for this application though.
No if you were to click a button, like a GUI then I would say you should use MouseButton1Click or Activated
Okay, will do. Thank you
No problem