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

Help with a pick script

Crunch

Member
Joined
Jun 21, 2011
Messages
353
Reaction score
19
Location
England
Hello,

I want to make this so when I use a pick on a certain item, it will change into a ladder for x seconds, then change back to its original form. I put this script onto pick.lua, and set the actionid, but it gives an error:

Code:
[Error - Action Interface] 
In a timer event called from:
data/actions/scripts/tools/pick.lua
Description:
<luaDoTransformItem> Item not found

Script:

Lua:
local newItemID =  8281
local oldID = 407

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.actionid == 7711 then
        doTransformItem(itemEx.uid, newItemID)
        addEvent(changeBack, 2000, itemEx, oldID)
    end
    return true
end

function changeBack(item, id)
    doTransformItem(item.uid, id)
    return true
end

Thanks
 
Lua:
 function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.actionid == 7711 then
        doTransformItem(itemEx.uid, 8281)
        addEvent(changeBack, 2000, itemEx, 407)
    end
    return true
end
 
function changeBack(item, id)
    doTransformItem(item.uid, id)
    return true
end
 
Code:
local newItemID = 8281
local oldID = 407
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.actionid == 7711 then
		doTransformItem(itemEx.uid, newItemID)
		addEvent(changeBack, 2000, newItemID, toPosition)
	end
	return true
end
 
function changeBack(i, p)
	local v = getTileItemById(p, i).uid
	if v > 0 then
		doTransformItem(v, oldID)
	end
end
 
Back
Top