Hello! You might remember me from such classics as 'Asked for help yesterday' and 'guy rips hair out because hes stupid', I've been working on trying to get a IF string work to shorten the name of targets if its too long, but I cannot get it to work and I just can't figure out what I'm doing wrong. I looked online and as far as I can tell, my code looks correct.
PHP Code:
function()
-- Set Level Variables
local Level = UnitLevel("target")
local Level = "[" .. Level .. "]"
-- Set Name Variables
local Name = GetUnitName("target")
local NameL = string.len(Name)
-- If Name is longer then 12
-- cut it off
Number = "12"
if NameL >= Number then
local Name = Name:sub(1,12) .. "..."
end
-- Display
local Display = Level .. Name
return Display
end
All this returns is a ? by the way, thanks in advance, again. ._.