• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Vip Per Hour Script 0.4

Owner Maydel

Evolera.Tk
Joined
Aug 16, 2015
Messages
302
Reaction score
40
Location
Egypt
I got a idea i need make like a action script any one have 50 token get 1 hour vip and in 1 hour the vip done he left to the temple directly!.
 
u have to use same storage in vip door or u can use talkaction or post ur vip door
Code:
local storage = 1002441
local function Back(cid)
   if(isPlayer(cid)) then
doSendAnimatedText(getCreaturePosition(cid), "VIP", TEXTCOLOR_YELLOW)
   end
   return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getCreatureStorage(cid, storage) <= os.time() and doPlayerRemoveItem(cid, 2157, 100) then  
    doPlayerRemoveItem(cid, 2157, 100)
   doCreatureSetStorage(cid, storage, os.time() + 60 * 60 * 1)
    addEvent(Back,2000,cid)
   local position = getCreaturePosition(cid)
  for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 30)
end
       else
  doPlayerSendCancel(cid, 'You have already vip and you can buy again in ' ..  secondsToClock(math.abs(os.difftime(getCreatureStorage(cid, storage), os.time())))  .. '.')
         end
         return true
       end

and add this in lib 0.50
Code:
function secondsToClock(sSeconds)
                local nSeconds = tonumber(sSeconds)
                if nSeconds == 0 then
                    return "00:00:00"
                else
                    local nHours = string.format("%02.f", math.floor(nSeconds / 3600))
                    local nMins = string.format("%02.f", math.floor(nSeconds / 60 - (nHours * 60)))
                    local nSecs = string.format("%02.f", math.floor(nSeconds - nHours * 3600 - nMins * 60))

                    return nHours..":"..nMins..":"..nSecs
                end
            end
 
Last edited:
u have to use same storage in vip door or u can use talkaction or post ur vip door
Code:
local storage = 1002441
local function Back(cid)
   if(isPlayer(cid)) then
doSendAnimatedText(getCreaturePosition(cid), "VIP", TEXTCOLOR_YELLOW)
   end
   return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getCreatureStorage(cid, storage) <= os.time() and doPlayerRemoveItem(cid, 2157, 100) then 
    doPlayerRemoveItem(cid, 2157, 100)
   doCreatureSetStorage(cid, storage, os.time() + 60 * 60 * 1)
    addEvent(Back,2000,cid)
   local position = getCreaturePosition(cid)
  for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 30)
end
       else
  doPlayerSendCancel(cid, 'You have already vip and you can buy again in ' ..  secondsToClock(math.abs(os.difftime(getCreatureStorage(cid, storage), os.time())))  .. '.')
         end
         return true
       end

and add this in lib 0.50
Code:
function secondsToClock(sSeconds)
                local nSeconds = tonumber(sSeconds)
                if nSeconds == 0 then
                    return "00:00:00"
                else
                    local nHours = string.format("%02.f", math.floor(nSeconds / 3600))
                    local nMins = string.format("%02.f", math.floor(nSeconds / 60 - (nHours * 60)))
                    local nSecs = string.format("%02.f", math.floor(nSeconds - nHours * 3600 - nMins * 60))

                    return nHours..":"..nMins..":"..nSecs
                end
            end
got error when i use it its said u already vip u can use it in 123123123,60,59
 
vip for hour items
Code:
local storage = 1002441
local function Back(cid)
   if(isPlayer(cid)) then
doSendAnimatedText(getCreaturePosition(cid), "VIP", TEXTCOLOR_YELLOW)
   end
   return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getCreatureStorage(cid, storage) <= os.time()  then
   doCreatureSetStorage(cid, storage, os.time() + 60 * 60 * 1)
    addEvent(Back,2000,cid)
   local position = getCreaturePosition(cid)
  for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 30)
end
       else
  doPlayerSendCancel(cid, 'You have already vip and you can buy again in ' ..  secondsToClock(math.abs(os.difftime(getCreatureStorage(cid, storage), os.time())))  .. '.')
         end
         return true
       end

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.actionid == 9975 and (doPlayerRemoveItem(cid, 6527, 50) == TRUE) and getPlayerFreeCap(cid) >= 100 then
doPlayerAddItem(cid, 9003, 1) ---- the item id for vip
doCreatureSay(cid, "You bought Vip booster.", TALKTYPE_ORANGE_1)
elseif item.itemid == 1946 and getPlayerFreeCap(cid) >= 85 then
doPlayerSendTextMessage(cid,21,"Please Try Again!")
doTransformItem(item.uid, item.itemid - 1)
else
doPlayerSendCancel(cid,"You don't got enought Token!")
end
return TRUE
end


and this script u need in sky
Code:
---- change items ids ----
local t = {
        [CONST_SLOT_HEAD] = {2457},  --- steel helmet
        [CONST_SLOT_ARMOR] = {2463}, --- plate armor
        [CONST_SLOT_LEGS] = {2647}, --- plate legs
        [CONST_SLOT_FEET] = {2643}, --- leather boots
        [CONST_SLOT_RING] = {2123}, ---- ring of the sky
        [CONST_SLOT_LEFT] = {2509},  --- shield must be in left hand
     
}
function onThink()
        for _, cid in ipairs(getPlayersOnline()) do
                local has = true
                for slot, ids in pairs(t) do
                        if not table.find(ids, getPlayerSlotItem(cid, slot).itemid) then
                                has = false
                                break
                        end
                end
                if has then
                        doSendAnimatedText(getThingPos(cid), 'WOW', TEXTCOLOR_YELLOW)
                end
        end
        return true
end
 
Last edited:
Back
Top