• 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!

First items helppp!!! fast

narko

vertrauenswürdig ~
Joined
Oct 19, 2008
Messages
1,317
Solutions
2
Reaction score
132
Location
Unknown
LUA:
local commonItems = {
  -- ITEMS ALL VOCS RECEIVE
  {itemid=2120, count=1}, -- rope
  {itemid=5710, count=1}, -- shovel
  {itemid=2420, count=1}, -- machete
  {itemid=2789, count=10}, -- brown mushrooms
  {itemid=2305, count=1}, -- fire bomb rune
  {itemid=2261, count=1}, -- destroy field rune
}

local firstItems = {
  { -- SORC ITEMS
    {itemid=8820, count=1}, -- hat of the mad
    {itemid=2463, count=1}, -- focus cape
    {itemid=2647, count=1}, -- blue legs
    {itemid=2643, count=1}, -- boots of haste
    {itemid=2525, count=1}, -- spellbook of mind control
    {itemid=2187, count=1}, -- wand of inferno 

    {itemid=7620, count=1}, -- gsp
    {itemid=7618, count=1}, -- gsp
    {itemid=2268, count=1}, -- sd
    {itemid=2293, count=1}, -- mw
    {itemid=2273, count=1}, -- uh
  },
  { -- DRUID ITEMS
    {itemid=8820, count=1}, -- hat of the mad
    {itemid=2463, count=1}, -- focus cape
    {itemid=2647, count=1}, -- blue legs
    {itemid=2643, count=1}, -- boots of haste
    {itemid=2525, count=1}, -- spellbook of mind control
    {itemid=2183 count=1}, -- wand of inferno 

    {itemid=7620, count=1}, -- gsp
    {itemid=7618, count=1}, -- gsp
    {itemid=2268, count=1}, -- sd
    {itemid=2293, count=1}, -- mw
    {itemid=2278, count=1}, -- paralyze
    {itemid=2273, count=1}, -- uh
  },
  { -- PALADIN ITEMS
    {itemid=2457, count=1}, -- hat of the mad
    {itemid=8872, count=1}, -- focus cape
    {itemid=2647, count=1}, -- blue legs
    {itemid=2643, count=1}, -- boots of haste
    {itemid=2525, count=1}, -- spellbook of mind control
    {itemid=7368, count=1}, -- assassin stars

    {itemid=7620, count=1}, -- gsp
    {itemid=7618, count=1}, -- gsp
    {itemid=2293, count=1}, -- mw
    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
  },
  { -- KNIGHT ITEMS
    {itemid=2457, count=1}, -- demon helmet
    {itemid=2463, count=1}, -- magic plate armor
    {itemid=2470, count=1}, -- golden legs
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2514, count=1}, -- mastermind shield
    {itemid=2400, count=1}, -- magic sword

    {itemid=8473, count=1}, -- uhp
  }
}

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

why doesn't works please help me
 
LUA:
local commonItems = {
	-- ITEMS ALL VOCS RECEIVE
	2120, -- rope
	5710, -- shovel
	2420, -- machete
	{2789, 10}, -- brown mushrooms
	2305, -- fire bomb rune
	2261 -- destroy field rune
}

local firstItems = {
	[1] = { -- SORC ITEMS
		2525, -- spellbook of mind control
		2187, -- wand of inferno
		2463, -- focus cape
		8820, -- hat of the mad
		2647, -- blue legs
		2643, -- boots of haste

		7620, -- gsp
		7618, -- gsp
		2268, -- sd
		2293, -- mw
		2273 -- uh
	},
	[2] = { -- DRUID ITEMS
		2525, -- spellbook of mind control
		2183, -- wand of inferno
		2463, -- focus cape
		8820, -- hat of the mad
		2647, -- blue legs
		2643, -- boots of haste

		7620, -- gsp
		7618, -- gsp
		2268, -- sd
		2293, -- mw
		2278, -- paralyze
		2273 -- uh
	},
	[3] = { -- PALADIN ITEMS
		2525, -- spellbook of mind control
		7368, -- assassin stars
		8872, -- focus cape
		2457, -- hat of the mad
		2647, -- blue legs
		2643, -- boots of haste

		7620, -- gsp
		7618, -- gsp
		2293, -- mw
		2268, -- sd
		2273 -- uh
	},
	[4] = { -- KNIGHT ITEMS
		2514, -- mastermind shield
		2400, -- magic sword
		2463, -- magic plate armor
		2457, -- demon helmet
		2470, -- golden legs
		2195, -- boots of haste

		8473 -- uhp
	}
}

for a = 1, #firstItems do
	for b = 1, #commonItems do
		table.insert(firstItems[a], commonItems[b])
	end
end

function onLogin(cid)
	if getPlayerAccess(cid) < 3 and getPlayerStorageValue(cid, 67708) == -1 then
		doPlayerAddItem(cid, 1988, 1)

		local items = firstItems[getPlayerVocation(cid)]
		for i = 1, #items do
			if type(items[i]) == 'table' then
				doPlayerAddItem(cid, items[i][1], items[i][2] or 1)
			else
				doPlayerAddItem(cid, items[i], 1)
			end
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have recieved your first items!')
		setPlayerStorageValue(cid, 67708, 1)
	end
	return true
end
 
Last edited:
Back
Top