• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

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

bpm91

Well-Known Member
Joined
May 23, 2019
Messages
535
Solutions
7
Reaction score
62
Location
Brazil
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

Ezzz

Developer of Nostalrius and The Violet Project
Joined
Feb 26, 2010
Messages
1,856
Solutions
3
Reaction score
757
Location
Spain, Europe
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.
 

emil92b

Intermediate OT User
Joined
Aug 21, 2013
Messages
313
Solutions
13
Reaction score
120
Location
Sweden
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
Top