• 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 Problem DoRemoveItem?

yolfran

Mapper-Chibcha
Joined
Jan 14, 2009
Messages
59
Reaction score
0
Location
Bucaramanga-Colombia!!!
I did this script , it was working ok until crying damson 0.3.4 but in 0.3.5 it doesn't works,i think the function DoCreateItem was changed.

The script put a ladder in a specific plece to continue a quest and remove's after a short time,but now nothing happens.

This is the script

PHP:
function onUse(cid, item, pos)
        local createPos = {x=555, y=457, z=12, stackpos=1}
    if  item.itemid == 1945 then
        doCreateItem(1386,ladder,createPos) 
        doPlayerSay(cid,"Continue the quest!!!",2)     
        addEvent(eventAdd,70000,b)
        doTransformItem(item.uid,item.itemid+1)
    elseif item.itemid == 1946 then
        doTransformItem(item.uid,item.itemid-1)
    else
    doPlayerSendCancel(cid,"The ladder its OK.")
    end
    return TRUE
end
function eventAdd(b)
local ladderpos = {x=555, y=457, z=12, stackpos=1}
local getladder = getThingfromPos(ladderpos)
doRemoveItem(getladder.uid, 1)
return TRUE
end

And this is the console err

[07/11/2009 16:16:56] Lua Script Error: [Action Interface]
[07/11/2009 16:16:56] in a timer event called from:
[07/11/2009 16:16:56] data/actions/scripts/questladder.lua:eek:nUse

[07/11/2009 16:16:56] luaDoRemoveItem(). Item not found

Then:

Why not appear the ladder?and if appear
Why not Disappear the ladder?

Plix i need help in the script!!
 
Lua:
local ladder = {{x=555, y=457, z=12}, 1386}
local event = 0

local function reset(leverPos)
	local lever = getTileItemById(leverPos, 1946).uid
	local ladder = getTileItemById{ladder[1], ladder[2]).uid
	if lever > 0 then doTransformItem(lever, 1945) end
	if ladder > 0 then doRemoveItem(ladder) end
end

function onUse(cid, item, pos) 
	if item.itemid == 1945 then
		doCreateItem(ladder[2], 1, ladder[1])
		doCreatureSay(cid, "Continue the quest!!!", TALKTYPE_YELL)
		event = addEvent(reset, 70 * 1000, getThingPos(item.uid))
		doTransformItem(item.uid, 1946)
	elseif item.itemid == 1946 then
		stopEvent(event)
		doTransformItem(item.uid, 1945)
		local ladder = getTileItemById(config.pos, config.ladderId).uid
		if ladder > 0 then doRemoveItem(ladder) end
	end
	return true
end
 
Last edited:
OMG you're faster.

Well, now the ladder appears ;D but not disappear,its not important but i want the ladder disappear 'cause the swith its in other place far the ladder and the players go and kill a lot of monsters in the way.

If the ladder don't disappear the way will be easy to the second team in the quest :S
 
Yes i have a pair of errors:

With the first script

[07/11/2009 19:47:22] Lua Script Error: [Action Interface]
[07/11/2009 19:47:22] in a timer event called from:
[07/11/2009 19:47:22] data/actions/scripts/firesescalera.lua:eek:nUse

[07/11/2009 19:47:22] luaDoRemoveItem(). Item not found

This is with the second one

[07/11/2009 19:35:41] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/questladder.lua)
[07/11/2009 19:35:41] data/actions/scripts/questladder.lua:6: '}' expected near ')'
 
I was trying to found the error but I cant :S

[07/11/2009 20:27:12] Lua Script Error: [Action Interface]
[07/11/2009 20:27:12] in a timer event called from:
[07/11/2009 20:27:12] data/actions/scripts/questladder.lua:eek:nUse

[07/11/2009 20:27:12] attempt to index a nil value
[07/11/2009 20:27:12] stack traceback:
[07/11/2009 20:27:12] [C]: in function 'getTileItemById'
[07/11/2009 20:27:12] data/actions/scripts/questladder.lua:5: in function <data/actions/scripts/questladder.lua:4>
 
Last edited:
Zomg I never would've noticed that, because I didn't edit the script in Notepad++, but rather in browser.
 
Back
Top