Advertisement
MarcusWilstrup

GiveItemsOnLevelup[Eluna][TrinityCore]

Dec 17th, 2013
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. playerLevelUp = {}
  2.  
  3. playerLevelUp.GiveItems = {
  4. --[[
  5. {entryId, classId, level, itemCount} Should be self explanatory.
  6. {entryId, classId, level, itemCount} Add a new table for each item.
  7. {entryId, classId, level, itemCount}
  8. ]]
  9. }
  10. function playerLevelUp.GiveThoseItems(event, player)
  11.     local plrClass = player:GetClass()
  12.     local plrLevel = player:GetLevel()
  13.    
  14.     local p = 1
  15.     while (p <= #playerLevelUp.GiveItems) do
  16.         if(plrClass == playerLevelUp.GiveItems[p][2] and plrLevel == playerLevelUp.GiveItems[p][3]) then
  17.             player:AddItem(playerLevelUp.GiveItems[p][1], playerLevelUp.GiveItems[p][4])
  18.         end
  19.         p = p + 1
  20.     end
  21. end
  22. RegisterPlayerEvent(13, playerLevelUp.GiveThoseItems)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement