Closed Coldensjo closed 3 months ago
It's can be done via items.xml, 1) in script remove item 2) then create new one with broken glass id
<item id="123123" article="a" name="Some Broken Vial">
<attribute key="weight" value="TONES" />
<attribute key="decayTo" value="123122" /> << not broken vial
<attribute key="duration" value="AGES" />
</item>
It's can be done via items.xml,
- in script remove item
- then create new one with broken glass id
<item id="123123" article="a" name="Some Broken Vial"> <attribute key="weight" value="TONES" /> <attribute key="decayTo" value="123122" /> << not broken vial <attribute key="duration" value="AGES" /> </item>
Yes it's possible using items.xml but this means its fixed to 1 type of item and cannot be changed. I want to be able to turn 1 item into different items.
can you try use something like that?
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
item:setAttribute(ITEM_ATTRIBUTE_DECAYTO, 10176)
item:setAttribute(ITEM_ATTRIBUTE_DURATION, 30)
item:decay()
return true
end
PS: not tested, just checked implementations
Yea, it seems to work, can close this.
By submitting this feature issue, you agree to the following.
Pull Requests or Links to add this feature
No response
Request
Currently you cannot change what an item should decay to. I want to be able to do something like this.
Let's say I have a specific id, a vial. I want to transform this item into broken glass when clicked on, but I want it to transform back to the vial after a certain period, without having to make a completely new item.
It could be used to create some complex things.
Possible Solutions
No response