• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Need Help

Status
Not open for further replies.

husam

Member
Joined
Aug 23, 2008
Messages
2,216
Reaction score
10
Location
Iraq-Baghdad
Hello guys,I need help at a Firstitem.lua for lv 45's
for a war server lv 45's
PLEASE I NEED HELP!!!
 
BOLD = item id's
Code:
  local commonItems = {
  -- ITEMS ALL VOCS RECEIVE
  {itemid=[B]2480[/B], count=1}, 
  {itemid=[B]2463[/B], count=1}, 
  {itemid=[B]2647[/B], count=1}, 
  {itemid=[B]2643[/B], count=1}, 
  {itemid=[B]2160[/B], count=1}, 
}

local firstItems = {
  { -- SORC ITEMS
    {itemid=[B]2190[/B], count=1}, 
    {itemid=[B]2175[/B], count=1} 
  },
  { -- DRUID ITEMS
    {itemid=[B]2182[/B], count=1}, 
    {itemid=[B]2175[/B], count=1} 
  },
  { -- PALADIN ITEMS
    {itemid=[B]2456[/B], count=1}, 
    {itemid=[B]2544[/B], count=100} 
  },
  { -- KNIGHT ITEMS
    {itemid=[B]2392[/B], count=1}, 
    {itemid=[B]2525[/B], count=1} 
  }
}

for _, items in ipairs(firstItems) do
  for _, item in ipairs(commonItems) do
    table.insert(items, item)
  end
end

function onLogin(cid)
  if getPlayerGroupId(cid) < 2 then
    local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

    if hasReceivedFirstItems ~= 1 then
      --[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)

      local giveItems = firstItems[getPlayerVocation(cid)]

      if giveItems ~= nil then
        for _, v in ipairs(giveItems) do
          --doAddContainerItem(backpack, v.itemid, v.count or 1)
          doPlayerAddItem(cid, v.itemid, v.count or 1)
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved your first items!")
      end
      setPlayerStorageValue(cid, 67708, 1)
    end
  end
  return TRUE
end
 
Status
Not open for further replies.
Back
Top