function checkTag()
if (string.sub(getPlayerName(getLocalPlayer()), 1, 5) == "[TAG]") then --get his tag
outputChatBox("* Access granted!", 0, 255, 0, false) --shows the message to the user that has the [TAG] tag.
else --if he doesnt have the tag
outputChatBox("* Access denied, only TAG people are allowed in this team.", 255, 0, 0, false) -- show the access denied msg.
end
end
Now just use onClientGUIClick to trigger the function.
Please correct me if there is a bug in it.