• 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 Lever stop to work

  • Thread starter Thread starter Evil Puncker
  • Start date Start date
Status
Not open for further replies.
Else should this one work.
Code:
local e = 0
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		doRemoveItem(getTileItemById({x=195, y=99, z=11}, 1353).uid)
		e = addEvent(doCreateItem, 60000, 1353, 1, {x=747, y=1043, z=7})
	else
		stopEvent(e)
		e = 0
		doCreateItem(1353, 1, {x=195, y=99, z=11})
	end
	return 1, doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
return 1
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local wallchk = getTileItemById({x=195, y=99, z=11}, 1353).uid

        if item.itemid == 1945 and wallchk > 0 then
                doRemoveItem(wallchk)
                doTransformItem(item.uid, 1946)
                addEvent(doCreateItem, 5 * 60 * 1000, 1353, 1,{x=195, y=99, z=11}) 

        elseif item.itemid == 1946 then
                doTransformItem(item.uid, 1945)
        else
                doPlayerSendCancel(cid, 'XXXXXXWRITEXXXXXX.')
        end
        return true
end

and in action.xml add this:

Code:
<action uniqueid="lever-uniqueid" script="scriptname.lua" />

Bye
 
Status
Not open for further replies.
Back
Top