Hi,
I couldn't find any similar topic so I created this one. My problem is, that I don't know how to make this function on 1 specific position, I mean a box that would give 1 item only from 1 position. I tried to make this with pos parameter at actions.xml but no result, every box with id 1738 giving item with ID 22391 and I want to make it only 1 specific box with
pos ={ x=33502,y=32545,z=7}
actions.xml
<action itemid="1738" pos="33502;32545;7" script="roshamuul/item.lua"/>
Item.lua
I couldn't find any similar topic so I created this one. My problem is, that I don't know how to make this function on 1 specific position, I mean a box that would give 1 item only from 1 position. I tried to make this with pos parameter at actions.xml but no result, every box with id 1738 giving item with ID 22391 and I want to make it only 1 specific box with
pos ={ x=33502,y=32545,z=7}
actions.xml
<action itemid="1738" pos="33502;32545;7" script="roshamuul/item.lua"/>
Item.lua
Lua:
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
local exhaustion = player:getStorageValue(1231231)
local item = 23391
local pos = {x=33502,y=32545,z=7}
if os.time() <= exhaustion then
player:sendCancelMessage("Nothing seems to happen....")
return true
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a mouthpiece for a horn.")
player:addItem(22391, 1)
player:setStorageValue(1231231, os.time() + (1 * 60 * 30))
return true
end
Last edited: