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

Solved How to change Item Unique or Action Id with function

whitevo

Feeling good, thats what I do.
Joined
Jan 2, 2015
Messages
3,452
Solutions
1
Reaction score
626
Location
Estonia
Cannot find working method for changing item unique ID
I am using TFS 1.0 Client 10.41

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.uid == 1003 then   
        local p = {x=527,y=768,z=8} -- TP coordinates
        doTeleportThing(cid,p)
        doItemSetAttribute(uid, 1004)
    elseif item.uid == 1004 then   
        local p = {x=527,y=768,z=9} -- TP coordinates
        doTeleportThing(cid,p)
        doItemSetAttribute(uid, 1003)
    else
    return false
    end
end

here is my latest test.. I tried lot of different lines, none of them work, some give errors, some nothing. Anyone knows what is the correct method?
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    Player(cid):teleportTo(Position(527, 768, 9))
    Item(item.uid):setAttribute(ITEM_ATTRIBUTE_UNIQUEID, item.uid == 1003 and 1004 or 1003)
    return true
end
 
Back
Top