I am trying to make a list of buttons that all need to execute the same general thing but with slightly different names, cost, among other data. I'm not sure how to put in extra parameters other than who triggered it without writing separate functions. For example:
function onclick(player,GuiObject) -- How can you get the GuiObject
print(player.. " clicked ".. GuiObject)
end
GuiObject.MouseButton1Click:Connect(onclick)
How would I get the GuiObject without writing a function for each event?

4 comments
Someone had the same question yesterday if you want some more info about it https://scriptinghelpers.org/questions/90481/how-does-this-function-keep-passing-a-nil-value#83843
Wait can an in pairs loop connect events all at once? Won't that disable the connection?
in pairs loop is just a for loop but for feasibility with objects in a table. all of them will have the same event and no, it does not disable the connections.
Thank you, this really simplifies the code I have to write.