• 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 How to change/set items attributes in TFS 1.2?

darkshin

New old member
Joined
Dec 14, 2010
Messages
231
Reaction score
22
Heey Guys!!

I was trying to modify items attributes using the lua function "setAttribute(key, value)" at a random items, just to see how it works, but It doesn't worked out for me. What happened was, the item supposedly got a Unique ID became immovable, the attributes remained the same.

This is the simple Lua code I used
Code:
if tile:getItemById(1739) then
           local item = tile:getItemById(7404)
          
           if item then
           player:say("Modified.", TALKTYPE_MONSTER_SAY)
           item:setAttribute(10, 1) //SHOULD SET WEAPON ATK TO 1
           end

Anyone know how to do it ? @Printer
 
Heey Guys!!

I was trying to modify items attributes using the lua function "setAttribute(key, value)" at a random items, just to see how it works, but It doesn't worked out for me. What happened was, the item supposedly got a Unique ID became immovable, the attributes remained the same.

This is the simple Lua code I used
Code:
if tile:getItemById(1739) then
           local item = tile:getItemById(7404)
         
           if item then
           player:say("Modified.", TALKTYPE_MONSTER_SAY)
           item:setAttribute(10, 1) //SHOULD SET WEAPON ATK TO 1
           end

Anyone know how to do it ? @Printer

Code:
    ITEM_ATTRIBUTE_ATTACK = 1 << 10,

Use ITEM_ATTRIBUTE_ATTACK or 2^10 as key
 
Hello,
Sorry for refreshing an old case, but i have an issue very similar to this case.
In my server i can feel that value of attack is changed (using a weapon for example), but the value of Atk: in the name of the item remains untouched.
Is there a way to enable refreshing this values in the server? (tfs 1.2).
Thanks in advance for help.
 
Back
Top