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

DoRemoveItem - item not found [Avesta 7.6]

Ecstacy

Mothafuckaaa
Joined
Dec 26, 2008
Messages
3,836
Reaction score
108
Location
The Netherlands
Hey,

I got a problem with a script; it won't remove a ladder, even though the UID and ITEMID are found.

This is the script:
Lua:
local t = {
	leverpos = {x=32888,y=32255,z=12,stackpos=1},
	ladderpos={x=32854,y=32321,z=11,stackpos=1},
	ladderpos2={x=32854,y=32321,z=11,stackpos=1},
	sec = 5
	}

function recreate(pos,itemid)
	broadcastMessage('The ladder has been created, it will be removed in '..t.sec..' seconds!')
	doCreateItem(itemid,1,pos)
end

function onStepIn(cid, item, frompos, item2, topos)
local lever,ladder = getTileThingByPos(t.leverpos),getTileThingByPos(t.ladderpos)
	if lever.itemid == 1946 then
		if ladder.itemid == 0 then
			recreate(t.ladderpos,1386)
			addEvent(print,t.sec*1000,'----\n'..getTileThingByPos(t.ladderpos2).itemid..' [uid: '..getTileThingByPos(t.ladderpos2).uid..']')
			addEvent(doRemoveItem,t.sec*1000,getTileThingByPos(t.ladderpos2).uid,1)
			addEvent(broadcastMessage,t.sec*1000,'The ladder has dissapeared.')
		else
			doRemoveItem(ladder.uid,1)
			doPlayerSendCancel(cid,'The ladder is still there, wait until it dissapears!')
		end
	else
		doPlayerSendCancel(cid,'You haven\'t pulled the switch yet!')
	end
	return true
end

In console:
consoleerrorladder.jpg


Thanks in advance.
 
Back
Top