Someone requested just a simple use item and receive items back.
It is intended for TFS 1.2 and I haven't tested it at all.
./actions.xml
./actions/scripts/SCRIPT.LUA
--Credit to tetra20 for fixing bugs, but still report an issue
It is intended for TFS 1.2 and I haven't tested it at all.
./actions.xml
Code:
<action itemid="ITEMID" script="SCRIPT.LUA" />
./actions/scripts/SCRIPT.LUA
Code:
local config = {storage = 1000, canclemsg = "You've already used this item!",
reward = {1992, 1993}
}
function onUse(player, item)
if player:isPlayer and player:getStorageValue(config.storage) <= 0 then
for gift = 1, #config.reward do
player:addItem(config.reward[gift], 1)
player:setStorageValue(config.storage, 1)
end
else
player:sendTextMessage(MESSAGE_STATUS_WARNING, config.canclemsg, player:getPosition())
end
end
Last edited: