• 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 -=[TFS]=- 0.4 8.60 Need Script of Image GIF

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
Need Script of Image GIF Script no Funcion show that


p.png


ACTION:
Lua:
local storageValue = 13741
local itemID = 8981
local teleportPosition = {x = 154, y = 51, z = 7}
local cooldownTime = 30 * 60
local timeInterval = 60
local countdownTextEffect = 21
local animetextEffect = 67
local animetextEffectInterval = 5

function sendBuffActiveText(cid, remainingTime)
    local minutes = math.floor(remainingTime / 60)
    local seconds = remainingTime % 60

    doSendAnimatedText(getCreaturePosition(cid), "Aguarde mais " .. minutes .. " minutos e " .. seconds .. " segundos", animetextEffect)

    if remainingTime > 0 then
        addEvent(sendBuffActiveText, animetextEffectInterval * 1000, cid, remainingTime - animetextEffectInterval)
    end
end

function sendCountdownText(cid, remainingTime)
    local minutes = math.floor(remainingTime / 60)
    local seconds = remainingTime % 60

    doSendAnimatedText(getCreaturePosition(cid), "Aguarde mais " .. minutes .. " minutos e " .. seconds .. " segundos", countdownTextEffect)
end

function onUse(cid, item, frompos, item2, topos)
    local lastUsageTime = getPlayerStorageValue(cid, "lastUsageTime")
    local currentTime = os.time()

    if lastUsageTime ~= -1 and currentTime < lastUsageTime + cooldownTime then
        local remainingTime = (lastUsageTime + cooldownTime) - currentTime
        sendCountdownText(cid, remainingTime)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Aguarde mais " .. math.floor(remainingTime / 60) .. " minutos e " .. remainingTime % 60 .. " segundos antes de usar novamente.")
        return true
    end

    if getPlayerStorageValue(cid, storageValue) ~= -1 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já tem acesso a essa funcionalidade.")
        return true
    end

    local hasUnlimitedCharges = getPlayerStorageValue(cid, "hasUnlimitedCharges") == 1

    if not hasUnlimitedCharges and not doPlayerRemoveItem(cid, itemID, 1) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa ter o item necessário para usar essa funcionalidade.")
        return true
    end

    local expirationTime = currentTime + (30 * 60)

    setPlayerStorageValue(cid, storageValue, expirationTime)
    setPlayerStorageValue(cid, "lastUsageTime", currentTime)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você ganhou acesso a essa funcionalidade por 30 minutos.")

    sendCountdownText(cid, 30 * 60)

    addEvent(function()
        if isPlayer(cid) then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu tempo de acesso expirou.")
            doTeleportThing(cid, teleportPosition)
            setPlayerStorageValue(cid, storageValue, -1)
        end
    end, cooldownTime * 1000)

    addEvent(function()
        if isPlayer(cid) then
            local remainingTime = (getPlayerStorageValue(cid, storageValue) - os.time())
            sendBuffActiveText(cid, remainingTime)
        end
    end, animetextEffectInterval * 1000)

    return true

end

MOVEMENTS:
Lua:
function onStepIn(cid, item, position, fromPosition)

local sto = 13741 -- storage Aqui

 if isPlayer(cid) then
   if getPlayerStorageValue(cid, sto) >= 1 then
     doPlayerSendTextMessage(cid, 25, "Seja bem vindo a area.")
       else
         doTeleportThing(cid, fromPosition, true)
       doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
      doPlayerSendTextMessage(cid, 25, "Voce Nao Tem Acesso!")
   end
 end

I NEED THIS SCRIPT BELOW

HQTM23A (1).gif
 

Similar threads

Replies
0
Views
385
Back
Top