Hi!
I want to get the clicked gui label's text, what I clicked on. There is a loop, so I can't add the label an own ID, or I don't know how can I do it.
So I create labels in a loop(with the online players's name), and then under the onClientClick eventhandler, I retrieve the clickedElement type, but I get false. Everywhere I clicked, I get just false
slot = 0
for v, character in ipairs(getElementsByType("player")) do
local characterName = getElementData(character, "CharName")
local name = tostring(characterName)
slot = slot + 1
guiCreateLabel(440,230 + slot * (30) ,700,50,name,false)
end
function MemberClick ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement )
if (button == "left" and state == "up") then
local tipe = getElementType( clickedElement )
outputChatBox(tostring(tipe))
end
end
addEventHandler ( "onClientClick", root, MembeClick)