CastorFlynn
Member
- Joined
- Aug 29, 2021
- Messages
- 88
- Reaction score
- 8
The default script overwrites the item description with the buyer's name. How do I keep the original description and include the buyer's name with it?
For example:
For example:
You see a helmet of the ancients (Arm:8).
It weighs 27.60 oz.
The gem of the helmet is burned out and should be replaced. (Bought by John)
Lua:
function addItem(player, transactionId, itemId, itemCount, offerId)
local _itemId = tonumber(itemId)
local _itemCount = tonumber(itemCount)
local _offerId = tonumber(offerId)
local playerName = player:getName()
local deliver = deliverItem(player, _itemId, _itemCount)
local itemName = ItemType(_itemId):getName()
if deliver.item then
deliver.item:setAttribute('description', ('Bought by %s.'):format(playerName))
end
end