Ir para conteúdo

Featured Replies

Postado

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

 

 

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)

Resolvido por Vodkart

Ir para solução
  • Capitao wyz mudou o título para Ajuda simples de sistema de PET
  • Respostas 9
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • CREATURESCRIPT     mortepet.lua function isPetMonster(cid)     return getCreatureMaster(cid) == 0 and false or isPlayer(getCreatureMaster(cid)) end function onDeath(cid, corpse, dea

Postado

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

Postado
  • Autor
1 hora atrás, 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

 

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

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