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

TFS 1.X+ enchant helmet of the ancient tfs 1.5 nekiro

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
928
Solutions
7
Reaction score
127
Location
Brazil
YouTube
caruniawikibr
hello, I set up a script for the helmet to be enchanted through the red stone, but I realized that the red stone is not something like the helmet on it, in fact the helmet is enchanted on any stone. could anyone tell me how to fix it?

Lua:
local t = {
    useOn = 2147,
    newId = 2343
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if doPlayerRemoveItem(cid,2342,1) then
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, 2343, 1)
        doCreatureSay(cid, 'You recharged your ' .. getItemNameById(item.itemid), TALKTYPE_ORANGE_1)

    else
        doCreatureSay(cid, 'You must use it on a ' .. getItemNameById(t.useOn), TALKTYPE_ORANGE_1)
    end
    return true
end
 
Solution
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.itemid == 2147 then
        player:say("You recharged your helmet of the ancients.", TALKTYPE_ORANGE_1)
        item:transform(2343)
        item:decay()
        target:remove(1)
    else
        player:say("You must use it on a helmet of the ancients.", TALKTYPE_ORANGE_1)
    end
    return true
end
I can barely understand what do you mean, but, It only works on the item you specify it to in actions.xml, the "itemid" that then you proceed in using into the helmet.
 
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.itemid == 2147 then
        player:say("You recharged your helmet of the ancients.", TALKTYPE_ORANGE_1)
        item:transform(2343)
        item:decay()
        target:remove(1)
    else
        player:say("You must use it on a helmet of the ancients.", TALKTYPE_ORANGE_1)
    end
    return true
end
 
Solution
Back
Top