Advertisement
Skymagnum

[Create Wall] Warzone System

May 8th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. function onUse(cid, item, fromPosition, itemEx, toPosition)
  2.  
  3.     local ITEM_POS = {x = x, y = y, z = z}
  4.     local ITEM = getTileItemById(ITEM_POS, 17999)
  5.  
  6.     if (getGlobalStorageValue(17999) >= 6) then
  7.         if (ITEM.uid > 0) then
  8.            addEvent(doCreateItem, 30 * 1000, 17999, 1, toPosition)
  9.            doRemoveItem(ITEM.uid)
  10.         end
  11.     return setGlobalStorageValue(17999, 0)
  12.     end
  13.  
  14.     local error = nil
  15.     local k = 0
  16.  
  17.     for LOOP = 1, 8 do
  18.        if (doSummonCreature("Humongous Fungus", toPosition)) then
  19.           if (doSummonCreature("Hideous Fungus", fromPosition)) then
  20.              k = k + 1
  21.           else
  22.              error = debug.traceback("[WARNING] Can't create Hideous Fungus monster created " .. k .. "")
  23.           end
  24.        else
  25.           error = debug.traceback("[WARNING] Can't create Humongous Fungus " .. k .. "")
  26.        end
  27.     end
  28.  
  29.     if (error) then
  30.        print(error)
  31.     end
  32.  
  33.     local val = getGlobalStorageValue(17999) < 0 and 0 or getGlobalStorageValue(17999)
  34.  
  35.     return setGlobalStorageValue(17999, getGlobalStorageValue(17999) + val)
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement