View Single Post
06/05/14, 01:34 AM   #3
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
You're almost there but but not quite got it right.

Give this slight change a go

Lua Code:
  1. local function lootReceived(eventCode,receivedBy, itemName, quantity, itemSound, lootType, self)
  2.   Loot:SetText("You looted stuff!!!")
  3.   d(itemName)
  4. end
  5.  
  6. local function RegisterLootEvent(eventcode, name)
  7.   if (name == "PileOMobs") then
  8.     EVENT_MANAGER:RegisterForEvent("PileOMobs",EVENT_LOOT_RECEIVED, lootReceived)
  9.     Loot:SetText("Loot event registered.")   --- Note: Message probably won't appear at this stage
  10.   end
  11. end
  12.  
  13. function PileOMobsInit(self)
  14.   self:RegisterForEvent("PileOMobs", EVENT_ADD_ON_LOADED, RegisterLootEvent)
  15. end
  Reply With Quote