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

whats wrong?

leeebux

Awsome
Joined
May 18, 2009
Messages
116
Reaction score
17
Location
Sweden
Code:
function eventual(cid, item, wallpos)
        doCreateItem(3139,1,wallpos[1])
        doTransformItem(item.uid,item.itemid-2730)        
end

function onUse(cid, item, frompos, item2, topos)
        wallpos = {
        {x=1313, y=964, z=7, stackpos=1}
}
        getwalls = {
        getThingfromPos(wall1)
}

        if item.uid == 7002 and item.itemid == 2060 then
                doRemoveItem(getwalls[1].uid,1)
                doTransformItem(item.uid,item.itemid+2730)
                doCreatureSay(cid, "You just opened a secret passage!", TALKTYPE_ORANGE_1)
                addEvent(eventual, 10000, cid, item, wallpos)
        elseif item.uid == 7002 and item.itemid == 2061 then
                doPlayerSendCancel(cid,"You can't use this yet.")
        else
                doPlayerSendCancel(cid,"Sorry, not possible.")
        end
        return 1
end

I'm trying to make a "down stair tile" every-time a player pulls the the torch on the wall.
 
u can't remove tile item this is a first thing.

second one is a torch. You can't pull a torch, lmfao! Just press a button and fulfil your destiny!

thind one: there is no variable wall1. i think u wanted do the following:
LUA:
getwalls = {
        getThingfromPos(wallpos[1])
}

Last one, you have to rebiuld this script. either onUse and eventual.
 
LUA:
local function changeTileByPos(pos,id)
	pos.stackpos = STACKPOS_GROUND;
	return doCreateItem(id,1,pos);
end

local function transformBack(pos,id, toid)
	item = getTileItemById(pos,id);
	if(item.uid<1) then
		return false;
	return doTransformItem(item.uid,toid);
end

local config = {
	wallPosition = {x=1313, y=964, z=7, stackpos=STACKPOS_GROUND},
	stair_id = 1234,
	time_back = 10, --seconds
	time_to_active_torch = 100;
}
	
function onUse(cid, item, fromPosition, itemEx, toPosition)
		
	if item.itemid == 2060 then
		local itemid = getThingFromPos(config.wallPosition);
		changeTileByPos(config.wallPosition,config.stair_id);
		doTransformItem(item.uid,item.itemid+1)
		addEvent(transformBack,config.time_to_active_torch*1000,toPosition,item.itemid-1,item.itemid)
		doCreatureSay(cid, "You just opened a secret passage!", TALKTYPE_ORANGE_1)
		addEvent(changeTileByPos, config.time_back*1000, itemid, config.wallPosition)
	elseif item.itemid == 2061 then
			doPlayerSendCancel(cid,"You can't use this yet.")
	else
			doPlayerSendCancel(cid,"Sorry, not possible.")
	end
	return true
end
 
Back
Top