Advertisement
Rochet2

Untitled

Feb 5th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1.  
  2. local T = {123, 123, 123, 123} -- creature entries
  3.  
  4. local function Reward(player)
  5.     -- reward code (SQL?)
  6. end
  7.  
  8. local function OnDeath(pUnit, event, unit)
  9.     if(unit:GetObjectType() ~= "Player") then return end
  10.    
  11.     if(unit:IsInGroup()) then
  12.         for k,v in ipairs(unit:GetGroupPlayers()) do
  13.             Reward(v)
  14.         end
  15.     else
  16.         Reward(unit)
  17.     end
  18. end
  19.  
  20. for k,v in ipairs(T) do
  21.     RegisterUnitEvent(v, 4, OnDeath)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement