Ir para conteúdo

Featured Replies

Postado
  • Autor

local combat_values = {
    ["ice"] = 1,
    ["fire"] = 2,
    ["earth"] = 3,
    ["energy"] = 4,
    ["holy"] = 5,
    ["death"] = 6,
}

local config = {
    storage = 101010,
    time_storage = 101011,

    price = 0,
    delay = 0,

    msg = {
        default = "Por favor selecione um dos elementos disponíveis: Ice, Fire, Earth, Energy, Holy ou Death.",
        help = "Elementos disponíveis: Ice, Fire, Earth, Energy, Holy, Death.",
        invalid = "Digite um elemento válido! Fale !wand para saber os elementos disponíveis.",
        changed = "O elemento da wand foi trocado para %s.",
        nomoney = "Você não possui dinheiro.",
        delayed = "Você precisa esperar para trocar o efeito.",
    }
}

function onSay(cid, words, param)
    local param = param:lower()
    local value = combat_values[param]

    if param == "help" then
        doPlayerSendCancel(cid, string.format(config.msg.help, config.price))
     return
    end
    
    if param == "" then
        doPlayerSendCancel(cid, string.format(config.msg.default, config.price))
return
    end

    if not value then
        doPlayerSendCancel(cid, config.msg.invalid)
return
    end

    if getPlayerMoney(cid) < config.price then
        doPlayerSendCancel(cid, config.msg.nomoney)
return
    end

    if getPlayerMoney(cid) < config.price then
        doPlayerSendCancel(cid, config.msg.nomoney)
return
    end

    if getPlayerStorageValue(cid, config.time_storage) + config.delay > os.time() then
        doPlayerSendCancel(cid, config.msg.delayed)
return
    end
    
    if not (getPlayerItemCount(cid, 23607) >= 1) then
doPlayerSendCancel(cid, Você não possui a wand.)
return
end
    
    setPlayerStorageValue(cid, config.storage, value)
    setPlayerStorageValue(cid, config.time_storage, os.time())
    doPlayerRemoveMoney(cid, config.price)
    doPlayerSendCancel(cid, string.format(config.msg.changed, param))
return
end

prontinho, faltou colocar um not na frente já que a checagem é pra ver justamente se ele não tem a wand.

 

 

Heheh.. adivinha? Não funcionou. Pelo menos dessa vez há um erro no console pra dar uma ajudinha (y'

 

[Warning - Event::checkScript] Can not load script: scripts/fg/elemental_wand.lua

data/talkactions/scripts/fg/elemental_wand.lua:62: '>' expected near 'nòo'

 

Que trabalho.. e agora?

Obs: o script que está apresentando esse erro é esse mesmo que está acima em spoiler, do WhiteWolf

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

  • Respostas 8
  • Visualizações 1.7k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • como é a vip no seu server, é por premium? por database? por storage?? tem a função isVip(cid)? eu tinha lido errado haha o jeito que a AnaPaula falou resolve o problema!

  • e so add a função      if getPlayerItemCount(cid, IDDOITEM) == 1 then         doPlayerSendCancel(cid, voce nao tem o item necesserio) return     end     abaixo do      if getPlayerStorageValue(ci

  • local combat_values = {     ["ice"] = 1,     ["fire"] = 2,     ["earth"] = 3,     ["energy"] = 4,     ["holy"] = 5,     ["death"] = 6, } local config = {     storage = 101010,     time_storage = 101

Postado
local combat_values = {
    ["ice"] = 1,
    ["fire"] = 2,
    ["earth"] = 3,
    ["energy"] = 4,
    ["holy"] = 5,
    ["death"] = 6,
}


local config = {
    storage = 101010,
    time_storage = 101011,


    price = 0,
    delay = 0,


    msg = {
        default = "Por favor selecione um dos elementos disponíveis: Ice, Fire, Earth, Energy, Holy ou Death.",
        help = "Elementos disponíveis: Ice, Fire, Earth, Energy, Holy, Death.",
        invalid = "Digite um elemento válido! Fale !wand para saber os elementos disponíveis.",
        changed = "O elemento da wand foi trocado para %s.",
        nomoney = "Você não possui dinheiro.",
        delayed = "Você precisa esperar para trocar o efeito.",
    }
}


function onSay(cid, words, param)
    local param = param:lower()
    local value = combat_values[param]


    if param == "help" then
        doPlayerSendCancel(cid, string.format(config.msg.help, config.price))
     return true
    end
    
    if param == "" then
        doPlayerSendCancel(cid, string.format(config.msg.default, config.price))
return true
    end


    if not value then
        doPlayerSendCancel(cid, config.msg.invalid)
return
    end


    if getPlayerMoney(cid) < config.price then
        doPlayerSendCancel(cid, config.msg.nomoney)
return true
    end


    if getPlayerMoney(cid) < config.price then
        doPlayerSendCancel(cid, config.msg.nomoney)
return true
    end


    if getPlayerStorageValue(cid, config.time_storage) + config.delay > os.time() then
        doPlayerSendCancel(cid, config.msg.delayed)
return true
    end
    
    if not (getPlayerItemCount(cid, 23607) >= 1) then
doPlayerSendCancel(cid, "Você não possui a wand".)
return true
end
    
    setPlayerStorageValue(cid, config.storage, value)
    setPlayerStorageValue(cid, config.time_storage, os.time())
    doPlayerRemoveMoney(cid, config.price)
    doPlayerSendCancel(cid, string.format(config.msg.changed, param))
return true
end

copiei direto da ana e ela não tinha colocado o "Você não tem wand" entre aspas

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
  • Autor
  • Solução

local combat_values = {
    ["ice"] = 1,
    ["fire"] = 2,
    ["earth"] = 3,
    ["energy"] = 4,
    ["holy"] = 5,
    ["death"] = 6,
}


local config = {
    storage = 101010,
    time_storage = 101011,


    price = 0,
    delay = 0,


    msg = {
        default = "Por favor selecione um dos elementos disponíveis: Ice, Fire, Earth, Energy, Holy ou Death.",
        help = "Elementos disponíveis: Ice, Fire, Earth, Energy, Holy, Death.",
        invalid = "Digite um elemento válido! Fale !wand para saber os elementos disponíveis.",
        changed = "O elemento da wand foi trocado para %s.",
        nomoney = "Você não possui dinheiro.",
        delayed = "Você precisa esperar para trocar o efeito.",
    }
}


function onSay(cid, words, param)
    local param = param:lower()
    local value = combat_values[param]


    if param == "help" then
        doPlayerSendCancel(cid, string.format(config.msg.help, config.price))
     return true
    end
    
    if param == "" then
        doPlayerSendCancel(cid, string.format(config.msg.default, config.price))
return true
    end


    if not value then
        doPlayerSendCancel(cid, config.msg.invalid)
return
    end


    if getPlayerMoney(cid) < config.price then
        doPlayerSendCancel(cid, config.msg.nomoney)
return true
    end


    if getPlayerMoney(cid) < config.price then
        doPlayerSendCancel(cid, config.msg.nomoney)
return true
    end


    if getPlayerStorageValue(cid, config.time_storage) + config.delay > os.time() then
        doPlayerSendCancel(cid, config.msg.delayed)
return true
    end
    
    if not (getPlayerItemCount(cid, 23607) >= 1) then
doPlayerSendCancel(cid, "Você não possui a wand".)
return true
end
    
    setPlayerStorageValue(cid, config.storage, value)
    setPlayerStorageValue(cid, config.time_storage, os.time())
    doPlayerRemoveMoney(cid, config.price)
    doPlayerSendCancel(cid, string.format(config.msg.changed, param))
return true
end

copiei direto da ana e ela não tinha colocado o "Você não tem wand" entre aspas

 

 

Agora sim! O script está funcionando perfeito. Rep+ pra você xWhiteWolf! Valeu pela ajuda.

 

Vou apenas adicionar abaixo o script com um pequeno fix no trecho doPlayerSendCancel(cid, "Você não possui a wand".)

Observe que o . está fora das aspas. Também vou substituir "return true" por "return" para que os comandos que o player executar não apareçam na tela/chat.

 

Talkaction Script 100% funcional (Créditos: Eu & xWhiteWolf):

local combat_values = {
    ["ice"] = 1,
    ["fire"] = 2,
    ["earth"] = 3,
    ["energy"] = 4,
    ["holy"] = 5,
    ["death"] = 6,
}


local config = {
    storage = 101010,
    time_storage = 101011,


    price = 0,
    delay = 0,


    msg = {
        default = "Por favor selecione um dos elementos disponíveis: Ice, Fire, Earth, Energy, Holy ou Death.",
        help = "Elementos disponíveis: Ice, Fire, Earth, Energy, Holy, Death.",
        invalid = "Digite um elemento válido! Fale !wand para saber os elementos disponíveis.",
        changed = "O elemento da wand foi trocado para %s.",
        nomoney = "Você não possui dinheiro.",
        delayed = "Você precisa esperar para trocar o efeito.",
    }
}


function onSay(cid, words, param)
    local param = param:lower()
    local value = combat_values[param]


    if param == "help" then
        doPlayerSendCancel(cid, string.format(config.msg.help, config.price))
     return
    end
    
    if param == "" then
        doPlayerSendCancel(cid, string.format(config.msg.default, config.price))
return 
    end


    if not value then
        doPlayerSendCancel(cid, config.msg.invalid)
return
    end


    if getPlayerMoney(cid) < config.price then
        doPlayerSendCancel(cid, config.msg.nomoney)
return
    end


    if getPlayerMoney(cid) < config.price then
        doPlayerSendCancel(cid, config.msg.nomoney)
return 
    end


    if getPlayerStorageValue(cid, config.time_storage) + config.delay > os.time() then
        doPlayerSendCancel(cid, config.msg.delayed)
return
    end
    
    if not (getPlayerItemCount(cid, 23607) >= 1) then
doPlayerSendCancel(cid, "Você não possui a wand.")
return
end
    
    setPlayerStorageValue(cid, config.storage, value)
    setPlayerStorageValue(cid, config.time_storage, os.time())
    doPlayerRemoveMoney(cid, config.price)
    doPlayerSendCancel(cid, string.format(config.msg.changed, param))
return
end

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

  • 1 year later...

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.6k

Informação Importante

Confirmação de Termo