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

Order script

Junior er

New Member
Joined
May 20, 2008
Messages
59
Reaction score
0
Location
Chile
I need a script to quest knight lvl 35, 50, 75.
The script is to than give one item of three.
 
can you like explain more like as i got from you you need a script like 3 ques 1 for lvl 35 other 50 other 75 and like ea of them have 3 chest player can take only 1 item? or what
 
Here it is.

script.lua
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
      item1 = 55,
      item1name = "Sword",
      item2 = 55,
      item2name = "club",
      item3 = 55,
      item3name = "axe",      
      questStorage = 55446
}

 if item.actionid == 4100 then
      if getPlayerStorageValue(cid, config.questStorage) == -1 then
         doPlayerAddItem(cid, config.item1, 1)
         doPlayerSendTextMessage(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
         doPlayerSendTextMessage(cid, 22, "You have found a "..config.item1name..".")
         setPlayerStorageValue(cid, config.questStorage, 1) 
      else
          doPlayerSendTextMessage(cid, 22, "The chest is empty.")
      end
      
 elseif item.actionid == 4200 then
       if getPlayerStorageValue(cid, config.questStorage) == -1 then
         doPlayerAddItem(cid, config.item2, 1)
         doPlayerSendTextMessage(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
         doPlayerSendTextMessage(cid, 22, "You have found a "..config.item2name..".")
         setPlayerStorageValue(cid, config.questStorage, 1) 
      else
          doPlayerSendTextMessage(cid, 22, "The chest is empty.")
      end
      
 elseif item.actionid == 4300 then
       if getPlayerStorageValue(cid, config.questStorage) == -1 then
         doPlayerAddItem(cid, config.item3, 1)
         doPlayerSendTextMessage(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
         doPlayerSendTextMessage(cid, 22, "You have found a "..config.item2name..".")
         setPlayerStorageValue(cid, config.questStorage, 1) 
      else
          doPlayerSendTextMessage(cid, 22, "The chest is empty.")
      end
 end
 return TRUE
end

actions.xml
PHP:
<action actionid="4100" event="script" value="script.lua"/> 
<action actionid="4200" event="script" value="script.lua"/> 
<action actionid="4300" event="script" value="script.lua"/>
No mames diego no sabes hablar ni mierda de ingles xd
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
	[4100] = {
      item = 55,
	  questStorage = 55444
	  },
	[4100] = {
      item = 55,
	  questStorage = 55445
	  },
	[4100] = {
      item = 55,
      questStorage = 55446
	  }
}

local accion = config[item.actionid]
	if accion then
		if getPlayerStorageValue(cid, accion.questStorage) == -1 then
			doPlayerAddItem(cid, accion.item1, 1)
			doPlayerSendTextMessage(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
			doPlayerSendTextMessage(cid, 22, "You have found a "..getItemNameById(accion.item) ..".")
			setPlayerStorageValue(cid, accion.questStorage, 1)
		else
			doPlayerSendTextMessage(cid, 22, "The chest is empty.")
		end
	end
	return TRUE
end

say me what it need? S: level? something :D
 
Last edited:
test my script, if work rep++ me :D

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
     
      items = {item1, item2, item3},
	  storages = {50000, 50001, 50002}
	  
}

 if item.actionid == 4000 and getPlayerLevel(cid) == 35 or getPlayerLevel(cid) == 50 or getPlayerLevel(cid) == 75 then
      if getPlayerStorageValue(cid, config.storages) == -1 then
		 if(config.level == 35) then
		    doPlayerAdditem(cid,config.items[0])
           doPlayerSendTextMessage(cid, 22, "You have found a" getItemIdByName(config.items[0] ".")
			 doPlayerSendTextMessage(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
                setPlayerStorageValue(cid, config.storages[0])
			elseif(config.level == 50) then
                  doPlayerSendTextMessage(cid, 22, "You have found a" getItemIdByName(config.items[1] ".")
			   doPlayerSendTextMessage(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
		      doPlayerAdditem(cid,config.items[1])
                  setPlayerStorageValue(cid, config.storages[1])
			   elseif(config.level == 75) then
               doPlayerAdditem(cid,config.items[2])
                      doPlayerSendTextMessage(cid, 22, "You have found a" getItemIdByName(config.items[2] ".")
				 doPlayerSendTextMessage(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
                        setPlayerStorageValue(cid, config.storages[2])
                        
 else
   doPlayerSendCancel(cid, "You have already this quest")
else
     doPlayerSendCancel(cid, "You havent the requiered level") 
end
return TRUE
end                   				      
end
 
Last edited:
Back
Top