Alright so say I've got this code:
local OBJGui = player.PlayerGui.CatagoryGui.Frame
OBJGui.ObjectOne.MouseButton1Click:connect(function()
object = OBJGui.ObjectOne.Text
end)
OBJGui.ObjectTwo.MouseButton1Click:connect(function()
object = OBJGui.ObjectTwo.Text
end)
OBJGui.ObjectThree.MouseButton1Click:connect(function()
object = OBJGui.ObjectThree.Text
end)
OBJGui.ObjectFour.MouseButton1Click:connect(function()
object = OBJGui.ObjectFour.Text
end
Is there any way to do this more efficiently instead of making countless amounts of _______.MouseButton1Click:connect(function()
This just seems horribly inefficient to me considering things like shop guis. I've tried to google it, but found nothing . Thanks for the help.
