Hiho, i just write an script for quest chests.
You need an certain lvl to take the chest, i are sure it is simple or already released here. But i just post it anyway, maybe someone got use for it
NOTE: That script is not tested!
You need an certain lvl to take the chest, i are sure it is simple or already released here. But i just post it anyway, maybe someone got use for it
NOTE: That script is not tested!
Lua:
local config ={
level = 250, -- level to take the chest
storage = 58107, -- storage
alreadydonemsg = "You have already done this quest.", -- What message to say if you already done this quest!
tolowlevelmsg = "You need level 250 to take this chest!", -- What message to say if you are to low level!
donemsg = "You have found 100 crystal coins.", -- What message to say if you take the chest!
qnt = 100, -- How much crystal coins you will get in the chest!
itemid = 2160 -- Item Id of crystal coin.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,config.alreadydonemsg)
elseif getPlayerLevel(cid) >= config.level then
setPlayerStorageValue(cid, config.storage, 1)
doPlayerAddItem(cid, config.itemid, config.qnt)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,config.donemsg)
elseif getPlayerLevel(cid) < config.level then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,config.tolowlevelmsg)
end
return TRUE
end
Last edited: