Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- doLogScript2(62, SCRIPT_TYPE_ACTION)
- doLogScript(184, SCRIPT_TYPE_ACTION)
- local item = Item(itemm.uid)
- local storage = itemm.uid
- if player:getStorageValue(storage) > os.time() then
- player:sendTextMessage(MESSAGE_INFO_DESCR, 'Surprise nest is empty.')
- return true
- end
- local player = Player(cid)
- local surpriseNest = player:getStorageValue(4090)
- local now = os.time()
- local timePassed = now - surpriseNest
- if getPlayerLevel(cid) >= 150 then
- if timePassed >= 1 * 2 * 60 then
- player:setStorageValue(4090, now)
- player:addItem(16102, 1)
- player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found surprise nest.")
- player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
- else
- player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are exhausted by opening the previous surprise nest, find another one.")
- player:getPosition():sendMagicEffect(CONST_ME_POFF)
- end
- else
- player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need at least 150 level to participe in this event.")
- player:getPosition():sendMagicEffect(CONST_ME_POFF)
- end
- player:setStorageValue(storage, os.time() + 1 * 60)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement