Ir para conteúdo
  • Cadastre-se

(Resolvido)Ajuda simples de sistema de PET


Ir para solução Resolvido por Vodkart,

Posts Recomendados

Bom dia, Boa Tarde e Boa noite galera tudo bem ?, estou com um simples problema. gostaria que o pet depois que morresse levaria 1 minuto para q a pessoa pudesse usa o item para invocar ele novamente, alguem poderia me ajudar PF ????

  Citar

 

Mostrar mais  

 

Você tem o código disponível? Se tiver publique-o aqui: 

 

 

function onUse(cid, item, frompos, item2, topos)

local dolls = {
[2155] = {pet = "Pet Dalmata"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR
[2277] = {pet = "Pet Bode"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR

}

local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
local waittime = 60 -- Tempo de exhaustion em segundos
local strtime = 6660666 -- Storage, nunca usar a mesma em outra Script do mesmo tipo. Ex: mesmo creaturescript, mesmo action e etc...

if exhaustion.check(cid, strtime) then
doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, strtime) .. " segundos para usar esse item novemente.")
return true
end 
---------------------------------------------------
if not (getTilePzInfo(getCreaturePosition(cid))) then
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1)    -- MENSAGEM AO REMOVER O PET
exhaustion.set(cid, strtime, waittime)      -- checar time
end
return true
end

if item.itemid == 2155 then              -- ID DO ITEM 
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)      -- MENSAGEM AO SUMONAR O PET
doSendAnimatedText(getPlayerPosition(cid), "!!!", 180)
end
if item.itemid == 2277 then              -- ID DO ITEM 
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)      -- MENSAGEM AO SUMONAR O PET
doSendAnimatedText(getPlayerPosition(cid), "!!!", 180)
end 


else
doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return true
end
end


 

 

 

 

Editado por Capitao wyz (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Capitao wyz mudou o título para Ajuda simples de sistema de PET
  • Respostas 9
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

CREATURESCRIPT     mortepet.lua function isPetMonster(cid)     return getCreatureMaster(cid) == 0 and false or isPlayer(getCreatureMaster(cid)) end function onDeath(cid, corpse, deathList)     if not isPetMonster(cid) then         return true     end     local waittime = 60 -- Tempo de exhaustion em segundos     local strtime = 6660666 -- Storage, nunca usar a mesma em outra Script do mesmo tipo. Ex: mesmo creaturescript, mesmo action e etc...     local master = getCreatureMas

function onUse(cid, item, frompos, item2, topos)

local exstorage = 45718 
local time = 0*60

    if exhaustion.check(cid, exstorage) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você precisa esperar antes de usar novamente.")
        return TRUE
    end

local dolls = {
[2155] = {pet = "Pet Dalmata"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR
[2277] = {pet = "Pet Bode"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR

}

local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
local waittime = 60 -- Tempo de exhaustion em segundos
local strtime = 6660666 -- Storage, nunca usar a mesma em outra Script do mesmo tipo. Ex: mesmo creaturescript, mesmo action e etc...

if exhaustion.check(cid, strtime) then
doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, strtime) .. " segundos para usar esse item novemente.")
return true
end 
---------------------------------------------------
if not (getTilePzInfo(getCreaturePosition(cid))) then
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1)    -- MENSAGEM AO REMOVER O PET
exhaustion.set(cid, strtime, waittime)      -- checar time
end
return true
end

if item.itemid == 2155 then              -- ID DO ITEM 
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)      -- MENSAGEM AO SUMONAR O PET
doSendAnimatedText(getPlayerPosition(cid), "!!!", 180)
end
if item.itemid == 2277 then              -- ID DO ITEM 
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)      -- MENSAGEM AO SUMONAR O PET
doSendAnimatedText(getPlayerPosition(cid), "!!!", 180)
end 


else
doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return true
end
end

Link para o post
Compartilhar em outros sites
  Em 24/02/2022 em 01:45, Encrypton disse:

function onUse(cid, item, frompos, item2, topos)

local exstorage = 45718 
local time = 0*60

    if exhaustion.check(cid, exstorage) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você precisa esperar antes de usar novamente.")
        return TRUE
    end

local dolls = {
[2155] = {pet = "Pet Dalmata"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR
[2277] = {pet = "Pet Bode"}, -- ID DO ITEM E NOME DO MONSTRO QUE IRÁ SUMONAR

}

local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
local waittime = 60 -- Tempo de exhaustion em segundos
local strtime = 6660666 -- Storage, nunca usar a mesma em outra Script do mesmo tipo. Ex: mesmo creaturescript, mesmo action e etc...

if exhaustion.check(cid, strtime) then
doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, strtime) .. " segundos para usar esse item novemente.")
return true
end 
---------------------------------------------------
if not (getTilePzInfo(getCreaturePosition(cid))) then
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1)    -- MENSAGEM AO REMOVER O PET
exhaustion.set(cid, strtime, waittime)      -- checar time
end
return true
end

if item.itemid == 2155 then              -- ID DO ITEM 
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)      -- MENSAGEM AO SUMONAR O PET
doSendAnimatedText(getPlayerPosition(cid), "!!!", 180)
end
if item.itemid == 2277 then              -- ID DO ITEM 
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)      -- MENSAGEM AO SUMONAR O PET
doSendAnimatedText(getPlayerPosition(cid), "!!!", 180)
end 


else
doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return true
end
end

Mostrar mais  

 

Ola boa noite ainda estou com o mesmo problema, consigo sumonar mesmo depois que o pet  morre  :[ OBRIGADO PELA TENTATIVA !

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96847
    Tópicos
    519607
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo