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

Another noob request :-X

dalan valka

New Member
Joined
Dec 20, 2007
Messages
18
Reaction score
0
Couldnt find this one either

put dragon leathers, leather boots on pos1 and pos2 pull leaver and get dragon scale boots

heres what ive been trying but doesnt work it wont read the items

PHP:
function onUse(cid, item, frompos, item2, topos)
 
	local switchUniqueID = 5008  -- uniqueID of switch.
	local switchID = 1945 -- switch 1 id.
	local switch2ID = 1946 -- switch 2 id.
	local itemID = 5877
        local item2ID = 2643 -- item id.
	local itempos = {x=133, y=399, z=5, stackpos=255}
        local item2pos = {x=133, y=400, z=5, stackpos=255} -- were the item is to be placed.
	local playername = getPlayerName(cid)
	local getitem = getThingfromPos(itempos)
        local get2item = getThingfromPos(item2pos)
 
	if item.uid == switchUniqueID and item.itemid == switchID and getitem.itemid == itemID and 

get2item.item2ID == item2ID then
			doSendMagicEffect(itempos,10)
			doRemoveItem(getitem.uid,50)
                        doSendMagicEffect(item2pos,10)
			doRemoveItem(get2item.uid,1)
			doPlayerSendTextMessage(cid,22,"Dragon scale boots.") 
                        doPlayerAddItem(cid,8880,1)
			doTransformItem(item.uid,item.itemid+1)
	elseif item.uid == switchUniqueID and item.itemid == switch2ID then
			doTransformItem(item.uid,item.itemid-1)
	else
			doPlayerSendCancel(cid,"You do not have the required items.")
end
	return 1
end
 
1) Where are errors from console?
2) Try this
LUA:
function onUse(cid, item, frompos, item2, topos) 
    local itemID = 5877 
    local item2ID = 2643 
    local itempos = {x=133, y=399, z=5, stackpos=255} 
    local item2pos = {x=133, y=400, z=5, stackpos=255} 
    local getitem = getThingfromPos(itempos) 
    local get2item = getThingfromPos(item2pos) 
  
    if getitem.itemid == itemID and get2item.itemid == item2ID then 
    doSendMagicEffect(itempos,10) 
    doRemoveItem(getitem.uid,50) 
    doSendMagicEffect(item2pos,10) 
    doRemoveItem(get2item.uid,1) 
    doPlayerSendTextMessage(cid,22,"Dragon scale boots.")  
    doPlayerAddItem(cid,11113,1) 
    else 
    doPlayerSendCancel(cid,"You do not have the required items.") 
	end 
end
 
Hmmm dont know what i did wrong i didnt get any errors with mine but then again it didnt work but yours worked thanks a bunch. rep++


EDIT: Works with any amount of leathers and get error if pulled with no item

PHP:
function onUse(cid, item, frompos, item2, topos) 
    local itemID = 5877 
    local item2ID = 2643 
    local itempos = {x=133, y=399, z=5, stackpos=255} 
    local item2pos = {x=133, y=400, z=5, stackpos=255} 
    local getitem = getThingfromPos(itempos) 
    local get2item = getThingfromPos(item2pos) 
  
    if getitem.itemid == itemID and get2item.itemid == item2ID then 
    doSendMagicEffect(itempos,10) 
    doRemoveItem(getitem.uid,50) 
    doSendMagicEffect(item2pos,10) 
    doRemoveItem(get2item.uid,1) 
    doPlayerSendTextMessage(cid,22,"Dragon scale boots.")  
    doPlayerAddItem(cid,11113,1) 
    else 
    doPlayerSendCancel(cid,"You do not have the required items.") 
        end 
end

if pulled with no items

[27/05/2010 00:02:58] [Error - Action Interface]
[27/05/2010 00:02:58] data/actions/scripts/dragboots.lua:onUse
[27/05/2010 00:02:58] Description:
[27/05/2010 00:02:58] data/actions/scripts/dragboots.lua:17: attempt to call local 'getitem' (a table value)
[27/05/2010 00:02:58] stack traceback:
[27/05/2010 00:02:58] data/actions/scripts/dragboots.lua:17: in function <data/actions/scripts/dragboots.lua:1>



Any Ideas?
 
Last edited:
function onUse(cid, item, frompos, item2, topos)
local itemID = 5877
local item2ID = 2643
local itempos = {x=133, y=399, z=5, stackpos=255}
local item2pos = {x=133, y=400, z=5, stackpos=255}
local getitem = getThingfromPos(itempos)
local get2item = getThingfromPos(item2pos)

if getitem.itemid == itemID and getitem.type == 50 and get2item.itemid == item2ID then
doSendMagicEffect(itempos,10)
doRemoveItem(getitem.uid,50)
doSendMagicEffect(item2pos,10)
doRemoveItem(get2item.uid,1)
doPlayerSendTextMessage(cid,22,"Dragon scale boots.")
doPlayerAddItem(cid,11113,1)
else
doPlayerSendCancel(cid,"You do not have the required items.")
return 0
end
end

? :D
 
Back
Top