Ir para conteúdo

Featured Replies

Postado

aquilo foi pra responder a dúvida do @kbpaulo... eu não sei arrumar esse script seu aí não

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

  • Respostas 12
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Postado

aquilo foi pra responder a dúvida do @kbpaulo... eu não sei arrumar esse script seu aí não

 

 

ele ta me respondendo algo que ta no script... não mandei nada para ele so copiei o trecho do script dele.

e é claro que valor de storage dece e so configurar no lugar certo ou não conhece sistema de vip system por storage... 13500 xD... a storage e medida em tempo.

 

 

Lek não testei se tiver algo errado desculpa sao 6:54 da manha

 

------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE

configs = {

time = 60, ---- TIME IN MINUTES

needpa = FAlSE,

needlvl = {FALSE, level = 50},

costmana = {FALSE, mana = 300},

addrate = 100, -- Exp que vai adicionar em %

removeonuse = TRUE

}

function RestoreStorage()

if getPlayerStorageValue(cid, 62164) > 0 then

setPlayerStorageValue(cid, 62164, -1)

end

end

function getTime(s)

local n = math.floor(s / 60)

s = s - (60 * n)

return n, s

end

CreatureEventChecker = function(event, ...) -- Colex

if isCreature(arg[1]) then

event(unpack(arg))

end

end

creatureEvent = function(event, delay, ...) -- Colex

addEvent(CreatureEventChecker, delay, event, unpack(arg))

end

function getPlayerExtraExpRate(cid) -- By MatheusMkalo

return (getPlayerRates(cid)[8]-1)*100

end

]]>

domodlib('PotionExpConfigs')

if getPlayerStorageValue(cid, 62164) >= 1 then

return doPlayerSendTextMessage(cid, 22, "Voce ja esta com o efeito do Double EXP Scroll [1 Hora].")

end

if configs.needpa and not isPremium(cid) then

return doPlayerSendCancel(cid, "You need to be a premmium account to use this item.")

end

if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then

return doPlayerSendCancel(cid, "You need to be level " .. configs.needlvl.level .. " to use this item.")

end

if configs.costmana[1] then

if getCreatureMana(cid) < configs.costmana.mana then

return doPlayerSendCancel(cid, "You need " .. configs.costmana.mana .. " mana to use this item.")

else

doCreatureAddMana(cid, -configs.costmana.mana)

end

end

if configs.removeonuse then

doRemoveItem(item.uid, 1)

end

for i = configs.time*60, 1, -1 do

local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60))

if #a < 4 then

a = string.sub(a,1,2) .. "0" .. string.sub(a, 3)

end

if i == configs.time*60 then

creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "O efeito do Double EXP Scroll [1 Hora] acabou !")

end

creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "O efeito do Double EXP Scroll vai acabar em "..a..".")

end

doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100))

creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100)))

doPlayerSendTextMessage(cid, 22, "Voce ativou o Double EXP Scroll e tera 1 hora de double exp.")

setPlayerStorageValue(cid, 62164, os.time())

creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62164, 0)

addEvent(RestoreStorage, 60 * 1000)

return TRUE

]]>

domodlib('PotionExpConfigs')

local time = configs.time

if os.time()-getPlayerStorageValue(cid, 62164) < time *60 then

doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100))

creatureEvent(doPlayerSetExperienceRate, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100)))

creatureEvent(setPlayerStorageValue, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000 , cid, 62164, 0)

for i = (time*60-(os.time()-getPlayerStorageValue(cid, 62164))), 1, -1 do

local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60))

if #a < 4 then

a = string.sub(a,1,2) .. "0" .. string.sub(a, 3)

end

if i == (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) then

creatureEvent(doPlayerSendCancel, (time*60-(os.time()-getPlayerStorageValue(cid, 62164)))*1000, cid, "O efeito do Double EXP Scroll [1 Hora] acabou!")

end

creatureEvent(doPlayerSendCancel, ((time*60-(os.time()-getPlayerStorageValue(cid, 62164)))-i)*1000, cid, "O efeito do Double EXP Scroll vai acabar em "..a..".")

end

end

return TRUE

]]>

 

eu add essa função aqui nunca mechi com o mods

 

addEvent(RestoreStorage, 60 * 1000)

 

1 minuto ela vai tirar a storage do player.. so apra testar...ve ae.

Editado por kbpaulo (veja o histórico de edições)

Postado
  • Autor

Pegando o script que o WhiteWolf passou, seria:

local config = {  
    rate = 2, 
    storage = 1000, 
    expstorage = 1100, 
    register = 1200, 
    time = 14400, 
}  

function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if getPlayerStorageValue(cid, config.storage) <= 0 then 
        local rates = getPlayerRates(cid) 
        setPlayerStorageValue(cid, config.expstorage, rates[SKILL__LEVEL]) 
        setPlayerStorageValue(cid, config.register, 1) 
        itemEx=itemid == 9004 
        doCreatureSay(cid, "Your extra experience rate has been activated! It now is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid) 
        setPlayerStorageValue(cid, config.storage, os.time()+config.time)  
        doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+config.rate)  
        doRemoveItem(item.uid,1) 
        registerCreatureEvent(cid, "ExpStage") 
    else 
        doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid) 
    end 
return true 
end 
function onThink(cid, interval) 
    if getPlayerStorageValue(cid, config.register) == 1 then 
        if getPlayerStorageValue(cid, config.storage) <= os.time() then 
            doCreatureSay(cid, "Your extra experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid) 
            setPlayerStorageValue(cid, config.storage, 0) 
            setPlayerStorageValue(cid, config.register, 0) 
            local oldexp = getPlayerStorageValue(cid, config.expstorage) 
            doPlayerSetExperienceRate(cid, oldexp) 
            unregisterCreatureEvent(cid, "ExpStage") 
        end 
    end 
return true 
end 
function onLogin(cid) 
    if getPlayerStorageValue(cid, config.register) == 1 then 
        registerCreatureEvent(cid, "ExpStage") 
        local rates = getPlayerRates(cid) 
        doCreatureSay(cid, "Your extra experience rate is still here! It is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid) 
        if getPlayerStorageValue(cid, config.storage) > os.time() then 
        local oldexp = getPlayerStorageValue(cid, config.expstorage) 
        doPlayerSetExperienceRate(cid, oldexp+config.rate) 
        end 
    end     
return true 
end

Teria como fazer igual no script que postei para que apareça o tempo restante em forma de msg "playerCancel"?

Tipo no script la em cima, fica aparecendo ali em baixo em branco a cada segundo que passa, acho que seria nessa parte:

 

creatureEvent(doPlayerSendCancel, ((time*60-(os.time()-getPlayerStorageValue(cid, 62164)))-i)*1000, cid, "O efeito do Double EXP Scroll vai acabar em "..a..".")

Postado

então, mas no caso essa função creatureEvent foi justamente a função q ele criou que eu disse q era complexa auheuhuha eu não sei mexer nisso aí não

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado

Vou ver um tempinho aqui e tento resolver pra ti ainda hoje.

Da pra fazer muitos mistérios.

 

Abraços

Editado por Adriano SwaTT (veja o histórico de edições)

Gosta do meu trabalho?

Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs.

 

Atenciosamente,
Adriano Swatt'

 

Para ver meus tutoriais acesse meu perfil.

 

cbCyOSZ.png

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo