• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Portal charged decay after 12 hours

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
554
Solutions
1
Reaction score
61
Location
Lo Mochis, Sinaloa
I made this script based on other scripts, it is practically a portal, that when using 5 moonlight crystals it "load" and changes its id to a "loaded rock", but I would like to know how to use the storage so that it can be loaded every 12 hours.

setPlayerStorageValue(player,Storage.Moon.Rock, os.time() + 12 * 60 * 60)

Lua:
function onUse(cid, item, frompos, item2, topos)
local player = Player(cid)
playerposition = {x=17197, y=16807, z=7}

   if item.uid == 53000 then
      if item.itemid == 33940 then
        if getPlayerStorageValue(cid, Storage.Moon.Questline) == 4 then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Fuerzas extranas salen de esta roca, pero que son? deberia volver con Naoko a reportarlo...")
            player:setStorageValue(Storage.Moon.Questline, 5)
            player:setStorageValue(Storage.Moon.Mission02, 2)
         end
        if getPlayerStorageValue(cid, Storage.Moon.Questline) < 4 then
            player:sendTextMessage(MESSAGE_STATUS_WARNING, "Esta roca luce algo especial...")
            return true
        end
         if getPlayerStorageValue(cid, Storage.Moon.Questline) == 7 and player:getItemCount(24739) >= 5 then
             player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "SE HAN PRENDIDO UNAS LUCES EN LA ROCA, PARECE ESTAR CARGADA!...")
            item:transform(33941)
            player:removeItem(24739, 5)
         end
      elseif item.itemid == 33941 and getPlayerStorageValue(cid, Storage.Moon.Questline) == 7 then
         doTeleportThing(cid,playerposition)
         doSendMagicEffect(nplayer1pos,10)
         doSendMagicEffect(topos,6)
         doSendMagicEffect(frompos,6)
      end
   end
   return true
end
 
sript "opening"..
0: on use check storage timer, return if timer>os.time()
1: get item from position
2: transfor item (give this na tem as parameter to item:transform)
3: call addevent, time to execute 12h, function "transform"/item:transform(id)
4: set storage - os.time()+12h,
 
Back
Top