I'm not sure what exactly you want from the quotes, but this contains all possible information you need. The .. operator only works outside quotes and \" escapes quotes to make them printable within an existing string.
ChatFrame1:AddMessage("Why Hello There ".. UnitName .."(\"Player\")")
Fix your quote delimiters. A pair of apostrophes (') is not the same as a double-quote ("). Either is fine to use, but you must balance them: whatever you use to open the string must be used to close that same string.
Also, your unitname call is completely broken.
ChatFrame1:AddMessage("Why Hello There ".. UnitName("Player"))
Oh, I was talking to Fel, not Elsia. :-p And I'm making a heap of assumptions as to what Fel is actually trying to accomplish. We'll just have to see where the addon goes from here!
thanks a ton! I just have one more question. How would i make it so it has a 50% chance to display that? Once I know that and can think of a decent name i'll be working on this like crazy
if math.random() < 0.5 then -- math.random returns range 0-1. 0.5 is the 50% change point.
-- Send greeting here
ChatFrame1:AddMessage("Why Hello There ".. UnitName("Player"))
end
here's the addon code
any help would be greatly appreciated!
Also, your unitname call is completely broken.