aMyLabelOne = guiCreateLabel ( x,y,width,height,'FaHaD',false )
aMyLabelTwo = guiCreateLabel ( x,y,width,height,'Artisz',false )
aMyPositions = {
{ x,y,width,height,aMyLabelOne };
{ x,y,width,height,aMyLabelTwo };
-- Usage = { x,y,width,height,label }
-- This how to use this put your label values inside this table
-- X = Your label x
-- Y = Your label y
-- Width = Your label width
-- Height = Your label height
-- Label = The label verible
-- And see the results is should out put the labels text
-- You have to replace the x,y,width,height in the table and labels in here to see the results.
}
function isMouseInPosition ( x,y,width,height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end
addEventHandler ( 'onClientClick',root,
function ( button,state )
if ( button == 'left' and state == 'up' ) then
for _,aValue in ipairs ( aMyPositions ) do
if isMouseInPosition ( aValue[1],aValue[2],aValue[3],aValue[4] ) then
outputChatBox ( guiGetText ( aValue[5] ) )
end
end
end
end
)
@Artisz
PS. This is just an example.
+ Also i forgot to put 'break' so add it to the code.