Goal: I want a player to be able to always have a specific item in their purse which never moves. With this item, I'm going to setup an onUse script to pop-up a modalWindow for various things. This will function as a low effort custom menu within OTClient.
Issue: I'm not able to figure out how to create/place an item into a player's purse (my own or otherwise). For testing, I'm using a talk action registered with this lua script
I don't think it can get any more bare bones for a test run, but this results in nothing happening and nothing being returned/errors in console.
Does anyone know the correct syntax/functions to best accomplish this?
PS. The 2nd bit I'll need help on is maintaining a static item which can't be moved/removed/deleted from every player's purse (if this is even possible)
Issue: I'm not able to figure out how to create/place an item into a player's purse (my own or otherwise). For testing, I'm using a talk action registered with this lua script
Lua:
function onSay(player, words, param)
local purse = player:getSlotItem(CONST_SLOT_PURSE)
if purse then
purse:addItem(1949, 100)
end
end
XML:
<talkaction words="/scroll" separator=" " script="addscroll.lua" />
I don't think it can get any more bare bones for a test run, but this results in nothing happening and nothing being returned/errors in console.
Does anyone know the correct syntax/functions to best accomplish this?
PS. The 2nd bit I'll need help on is maintaining a static item which can't be moved/removed/deleted from every player's purse (if this is even possible)