Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 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.                 local storage = 58451
  11.                
  12.                 if player:getStorageValue(storage) > os.time() then
  13.                 return true
  14.                 end
  15.    
  16.                 if  player:getStorageValue(58450) < 0 then
  17.                 return true
  18.                 end
  19.                
  20.                 player:setStorageValue(58450, player:getStorageValue(58450) + 1)
  21.                 if  (player:getStorageValue(58450) == 5) then
  22.                 player:setStorageValue(storage, os.time() + 4 * 60 * 60)
  23.                 player:sendTextMessage(19, "You have rescued enought lost gnomes and gnome pack crawlers, report your mission to Gnomus.")
  24.                 end
  25.  
  26.             end
  27.             creature:remove()
  28.         end
  29.     end
  30.  
  31. end
  32.  
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement