bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 929
- Solutions
- 7
- Reaction score
- 127
- Location
- Brazil
- YouTube
- caruniawikibr
hello, I set up my own postman, and I would like to know how I can use the item in the mailbox, it only works if I use it directly in the box, could anyone help?
this is for the 2 scripts I made of the crowbar and santa's gift
<action actionid="10168" script="postman quest actions/postmanQuestCrowbar.lua" />
<action actionid="10174" script="postman quest actions/postmanQuestMail.lua" />
Crowbar
Bag
this is for the 2 scripts I made of the crowbar and santa's gift
<action actionid="10168" script="postman quest actions/postmanQuestCrowbar.lua" />
<action actionid="10174" script="postman quest actions/postmanQuestMail.lua" />
Crowbar
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local mailuid = 10168
local storage = 100171
local getstorage = getPlayerStorageValue(cid, storage)
if(getstorage == 7) then
setPlayerStorageValue(cid, 100168, 6)
setPlayerStorageValue(cid, 100169, 1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
else
setPlayerStorageValue(cid, 100168, 6)
setPlayerStorageValue(cid, 10169, 1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
return true
end
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 10174) == -1 and doPlayerTakeItem(cid, 2330, 1) then
setPlayerStorageValue(cid, 10174, 1)
setPlayerStorageValue(cid, 100168, 37)
doPlayerRemoveItem(cid, 2330, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You send mails.")
return true
end
if getPlayerStorageValue(cid, 10174) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have mails.")
end
return true
end