Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. function onStepIn(cid, item, frompos, item2, topos)
  2. local creature = Creature(cid)
  3.  
  4.  
  5. if creature ~= nil then
  6.     if creature:isMonster() then
  7.         if creature:getName() == "Gnome Pack Crawler" then
  8.             if creature:getTarget() ~= nil and creature:getTarget():isPlayer() then
  9.                 local player = Player(creature:getTarget())
  10.                
  11.                 local addStorage = true
  12.                 if player:getStorageValue(58451) > os.time() then
  13.                     addStorage = false
  14.                 end
  15.    
  16.                 if  player:getStorageValue(58450) < 0 then
  17.                     addStorage = false
  18.                 end
  19.                
  20.                 if player:getStorageValue(58450) == 5 then
  21.                     addStorage = false
  22.                 end
  23.                
  24.                 if addStorage then
  25.                     player:setStorageValue(58450, player:getStorageValue(58450) + 1)
  26.                     if player:getStorageValue(58450) == 5 then
  27.                         player:sendTextMessage(19, "You have rescued enought gnome pack crawlers, report your mission to Gnomus.")
  28.                     end
  29.                 end
  30.  
  31.             end
  32.             creature:remove()
  33.         end
  34.     end
  35.  
  36. end
  37.     return true
  38.  
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement