Actually, I was talking along the lines of something like this:
local images = {}
images[1] = guiCreateStaticImage(x, y, width, height, text, relative, parent)
images[2] = guiCreateStaticImage(x, y, width, height, text, relative, parent)
images[3] = guiCreateStaticImage(x, y, width, height, text, relative, parent)
-- ...
images[30] = guiCreateStaticImage(x, y, width, height, text, relative, parent)
function onClientGUIClickHandler(button, state, absoluteX, absoluteY)
for k, v in pairs(images) do
if (source == v) then
-- Code
end
end
end
addEventHandler("onClientGUIClick", root, onClientGUIClickHandler)
versus your method in terms of which one would be more efficient.