• 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 HELP! :((

Arita

:))
Joined
Dec 26, 2010
Messages
47
Reaction score
3
Location
Mexiiico!! :)
Hi guys :) so i have this little problem.. this should work but it doesnt :( look:

Firstitems.lua
Code:
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=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=7730, count=1}, -- blue legs
    {itemid=2195, count=1}, -- boots of haste
    {itemid=8902, count=1}, -- spellbook of mind control
    {itemid=2187, count=1}, -- wand of inferno 

    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=7590, count=1}, -- gmp
    {itemid=2293, count=1}, -- mw
  },
  { -- DRUID ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=7730, count=1}, -- blue legs
    {itemid=2195, count=1}, -- boots of haste
    {itemid=8902, count=1}, -- spellbook of mind control
    {itemid=2183, count=1}, -- hailstorm rod  

    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=7590, count=1}, -- gmp
    {itemid=2293, count=1}, -- mw
    {itemid=2269, count=1}, -- wg
    {itemid=2278, count=1}, -- para
  },
  { -- PALADIN ITEMS
    {itemid=2493, count=1}, -- demon helmet
    {itemid=8891, count=1}, -- paladin armor
    {itemid=7730, count=1}, -- blue legs
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2514, count=1}, -- mastermind shield
    {itemid=7368, count=1}, -- assassin stars

    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=8472, count=1}, -- gsp
    {itemid=7589, count=1}, -- smp
    {itemid=7588, count=1}, -- shp
    {itemid=2293, count=1}, -- mw
  },
  { -- KNIGHT ITEMS
    {itemid=2493, count=1}, -- demon helmet
    {itemid=2472, 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=7620, count=1}, -- mp
    {itemid=7591, count=1}, -- ghp
    {itemid=8473, count=1}, -- uhp
    {itemid=2273, count=1}, -- uh
    {itemid=2293, count=1}, -- mw
  }
}

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

Creaturescripts.xml
Code:
<event type="login" name="FirstItems" event="script" value="firstitems.lua"/



Do you guys see the error... because I dont :(
Will Rep+ if you helpme :)
 
Last edited:
ok let me help u with this, go to mods create a new file named firstitems.xml and paste this

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="" contact="" enabled="yes">
	<config name="firstitems_config"><![CDATA[
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')

		function onLogin(cid)
	if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
		if isSorcerer(cid) then
			doPlayerAddLevel(cid, 0) -- Level 8
			local bag = doPlayerAddItem(cid, 1988, 1)
	
			doAddContainerItem(bag, 2120, 1) -- Rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2160, 5) -- 50 platinum coints
		    doAddContainerItem(bag, 2173, 1) -- 50 platinum coints
			doAddContainerItem(bag, 2618, 1) -- Health Potion
			doAddContainerItem(bag, 2620, 1) -- Mana Potion
			
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2190, 1) -- wand of wortex
			doPlayerAddItem(cid, 2463, 1) -- plate armor
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2647, 1) -- plate legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddPremiumDays(cid, 0) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

		setPlayerStorageValue(cid, 50000, 1)

		elseif isDruid(cid) then
			doPlayerAddLevel(cid, 0) -- Level 8
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2173, 1) -- 50 platinum coints
		    doAddContainerItem(bag, 2160, 5) -- 50 platinum coints
		    doAddContainerItem(bag, 2618, 1) -- Health Potion
			doAddContainerItem(bag, 2620, 1) -- Mana Potion
			
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2182, 1) -- snakebite rod
			doPlayerAddItem(cid, 2463, 1) -- plate armor
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2647, 1) -- plate legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddPremiumDays(cid, 0) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			setPlayerStorageValue(cid, 50000, 1)

		elseif isPaladin(cid) then
			doPlayerAddLevel(cid, 0) -- Level 8
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2160, 5) -- 50 platinum coins
			doAddContainerItem(bag, 2173, 1) -- 50 platinum coints
			doAddContainerItem(bag, 2618, 1) -- Health Potion
			doAddContainerItem(bag, 2620, 1) -- Mana Potion
		
			doPlayerAddItem(cid, 2389, 1) -- spear
                        doPlayerAddItem(cid, 2456, 1) -- bow
			doPlayerAddItem(cid, 2544, 100) -- 100 arrows
			doPlayerAddItem(cid, 2660, 1) -- hidden turban
			doPlayerAddItem(cid, 2457, 1) -- steel helmet
			doPlayerAddItem(cid, 2647, 1) -- plate legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddPremiumDays(cid, 0) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			setPlayerStorageValue(cid, 50000, 1)

		elseif isKnight(cid) then
			doPlayerAddLevel(cid, 0) -- Level 8
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2160, 5) -- 50 platinum coins
			doAddContainerItem(bag, 2439, 1) -- daramanian mace
			doAddContainerItem(bag, 8601, 1) -- steel axe
			doAddContainerItem(bag, 2173, 1) -- 50 platinum coints
			doAddContainerItem(bag, 2618, 1) -- Health Potion
			doAddContainerItem(bag, 2620, 1) -- Mana Potion
		
			doPlayerAddItem(cid, 2525, 1) -- dwarven shield
			doPlayerAddItem(cid, 8602, 1) -- jagged sword
			doPlayerAddItem(cid, 2463, 1) -- plate armor
			doPlayerAddItem(cid, 2457, 1) -- steel helmet
			doPlayerAddItem(cid, 2647, 1) -- plate legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddPremiumDays(cid, 0) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			setPlayerStorageValue(cid, 50000, 1)
		end
	end
 	return TRUE
end
	]]></event>
</mod>
rep if i help
 
well u need to put samples to work, u have phpmyadmin?
if u have phpmyadmin, execute this query in SQL
SQL:
INSERT INTO `players` VALUES(0, 'Rook Sample', 0, 1, 1, 1, 0, 185, 185, 0, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 0, 0, 0, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
INSERT INTO `players` VALUES(1, 'Sorcerer Sample', 0, 1, 1, 8, 1, 185, 185, 4200, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 32369, 32238, 7, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
INSERT INTO `players` VALUES(2, 'Druid Sample', 0, 1, 1, 8, 2, 185, 185, 4200, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 32369, 32238, 7, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
INSERT INTO `players` VALUES(3, 'Paladin Sample', 0, 1, 1, 8, 3, 185, 185, 4200, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 32369, 32238, 7, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
INSERT INTO `players` VALUES(4, 'Knight Sample', 0, 1, 1, 8, 4, 185, 185, 4200, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 32369, 32238, 7, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
 
execute this query
SQL:
INSERT INTO `players` VALUES(0, 'Rook Sample', 0, 1, 1, 1, 0, 185, 185, 0, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 0, 0, 0, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
INSERT INTO `players` VALUES(1, 'Sorcerer Sample', 0, 1, 1, 8, 1, 185, 185, 4200, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 32369, 32238, 7, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
INSERT INTO `players` VALUES(2, 'Druid Sample', 0, 1, 1, 8, 2, 185, 185, 4200, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 32369, 32238, 7, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
INSERT INTO `players` VALUES(3, 'Paladin Sample', 0, 1, 1, 8, 3, 185, 185, 4200, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 32369, 32238, 7, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
INSERT INTO `players` VALUES(4, 'Knight Sample', 0, 1, 1, 8, 4, 185, 185, 4200, 44, 44, 44, 44, 128, 0, 0, 35, 35, 0, 100, 1, 32369, 32238, 7, '', 420, 1, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 0, 0, 0, 0, 100, 100, 0, 0, 0, 0, 0, '', 1287582995, 1, '', 1, '', 0, 0, 0);
 
no problem, well look, the samples are characters that you need to make a new character based in the the sample character, example if u create a character knight, your character will be based in the knight sample, so u need to add samples to make new characters, and get items, skills at first login, thats why u need to add samples, is really necessary, but u need execute that query to add those
 
Back
Top