Originally Posted by Spawnova
I have an addon I would like to print a line once a certain item is looted/receieved
but it never seems to do anything past "if event=="
Code:
local SKF = CreateFrame("frame")
local playerName = UnitName("player")
local keyName = "Scallions"
SKF:RegisterEvent("CHAT_MSG_LOOT")
SKF:SetScript("OnEvent",function(self,event,message)
if event=="CHAT_MSG_LOOT" then
local msg = string.gsub(message, "[", "")
print "event fired" --never fires
if string.match(msg,"You receive item: " .. keyName) then
print "looted"
end
end
end)
|
print shound be like print("whatever")