• 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 need script torch

chaosb

www.originaltibia.com
Joined
Sep 14, 2008
Messages
267
Reaction score
0
Location
Poland
its a naabie question but someone have script working torch? :O
 
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2050 then
doTransformItem(item.uid, 2051)
elseif item.itemid == 2051 then
doTransformItem(item.uid, 2050)
elseif item.itemid == 2052 then
doTransformItem(item.uid, 2053)
elseif item.itemid == 2053 then
doTransformItem(item.uid, 2052)
elseif item.itemid == 2054 then
doTransformItem(item.uid, 2055)
elseif item.itemid == 2055 then
doTransformItem(item.uid, 2054)
elseif item.itemid == 2047 then
doTransformItem(item.uid, 2048)
elseif item.itemid == 2048 then
doTransformItem(item.uid, 2047)
elseif item.itemid == 2044 then
doTransformItem(item.uid, 2045)
elseif item.itemid == 2045 then
doTransformItem(item.uid, 2044)
elseif item.itemid == 2041 then
doTransformItem(item.uid, 2042)
elseif item.itemid == 2042 then
doTransformItem(item.uid, 2041)
elseif item.itemid == 2057 then
doTransformItem(item.uid, 2041)
else
return 0
end
doDecayItem(item.uid)
return 1
end
 
If you are using TFS 0.3.5+ then your decayto.lua should look like this:

Code:
local ITEM_IDS = {
	[2041] = 2042,
	[2042] = 2041,
	[2044] = 2045,
	[2045] = 2044,
	[2047] = 2048,
	[2048] = 2047,
	[2050] = 2051,
	[2051] = 2050,
	[2052] = 2053,
	[2053] = 2051,
	[2054] = 2055,
	[2054] = 2055,
	-- crystal pedestals
	[9976] = 9977,
	[9977] = 9978,
	[9978] = 9979,
	[9979] = 9976
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(not ITEM_IDS[item.itemid]) then
		return false
	end

	doTransformItem(item.uid, ITEM_IDS[item.itemid])
	doDecayItem(item.uid)
	return true
end

This script handles the onUse transformation.
 
Code:
	[2053] = 2051,
	[2054] = 2055,
	[2054] = 2055,
I can't believe this still isn't fixed.
Code:
	[2053] = 205[B][COLOR="Red"]2[/COLOR][/B],
	[2054] = 2055,
	[205[B][COLOR="Red"]5[/COLOR][/B]] = 205[B][COLOR="Red"]4[/COLOR][/B],
 
Last edited:
XML:
<action itemid="2041;2042;2044;2045;2047;2048;2050-2055;9976-9979;1479;1480" event="script" value="custom/item/light.lua"/>

Lua:
local ITEM_IDS = {
    [2041] = 2042,
    [2042] = 2041,
    [2044] = 2045,
    [2045] = 2044,
    [2047] = 2048,
    [2048] = 2047,
    [2050] = 2051,
    [2051] = 2050,
    [2052] = 2053,
    [2053] = 2052,
    [2054] = 2055,
    [2055] = 2054,
    -- street lamp
    [1480] = 1479,
    [1479] = 1480,
    -- crystal pedestals
    [9976] = 9977,
    [9977] = 9978,
    [9978] = 9979,
    [9979] = 9976
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

    if(not ITEM_IDS[item.itemid]) then
        return false
    end

    doTransformItem(item.uid, ITEM_IDS[item.itemid])
    doDecayItem(item.uid)
    return true
end
 
Back
Top