• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua [TFS 1.2] One Question..

Caduceus

Unknown Member
Joined
May 10, 2010
Messages
321
Solutions
2
Reaction score
24
* First question: I am trying to add a duration to a Flash arrow, so that when the item decays it will go back to a normal arrow. However, when I set:
<attribute key="decayTo" value="xxxx" />
<attribute key="duration" value="1200" />
<attribute key="showduration" value="1" />
The duration will only countdown after player logs out & back in or on restart. If the item is unequipped then re equipped, duration stops. Is there a way to resolve this? It doesn't happen to all items.

** Second question (solved): How can I add a text to an item? Example a scroll through.
player:addItem(1949, 1):setText(text)
 
Last edited:
moveevent onEquip onDeEquip item:decay()

ITEM_ATTRIBUTE_TEXT
ITEM_ATTRIBUTE_DATE
ITEM_ATTRIBUTE_WRITER

item:setAttribute(ITEM_ATTRIBUTE_TEXT, "type something here")

date is timestamp and writer is guid I believe
 
Not sure what you mean here. Make a script for the items in movements to decay to 2544 after x amount of time?
movement script which will make arrows decay (tfs doesn't seem to do it by default in equip/deequip case)

item:decay()
 
Item decays on creation, but still stops duration on either Equip or DeEquip.

Code:
<movevent event="Equip" itemid="7838" slot="ammo" level="100" script="Equip.lua">
        <vocation name="Paladin"/>
        <vocation name="Royal Paladin" showInDescription="0"/>
        <vocation name="Warlord Paladin" showInDescription="0"/>
    </movevent>
    <movevent event="DeEquip" itemid="7838" slot="ammo" script="DeEquip.lua"/>

Code:
function onEquip(player, item, slot)
    item:decay()
return true
end
   
function onDeEquip(player, item, slot)
    item:decay()
return true
end
 
Back
Top