So I am wondering which is better to use, option 1 or option 2 is one better than another in certain situations?
local button = script.Parent.ClickDetector
--Option 1
button.MouseClick:Connect(function()
print("Button pressed")
end)
--Option 2
local function buttonPressed()
print("ButtonPressed")
end
button.MouseClick:Connect(buttonPressed)