PET SYSTEM!!! AJUDA!!

Thow
Por Thow
em Scripts

Thow

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/08/07Posts: 4

Olá pessoal, gostaria que alguem me ajudasse no script desse actions.

 

É um pet system bem simples, você clika em um item e o monstro sai... oq eu gostaria é que ao clicar no item novamente o monstro voltasse..

 

Se alguem puder ajudar agradeço, segue script:

 

local vocs_id = {3,7}

function onUse(cid, item, frompos, item2, topos)
      if not isInArray(vocs_id,getPlayerVocation(cid)) then       
         doPlayerSendCancel(cid,"Sua vocacao nao pode summonar esse pet.")   
         soSendMagicEffect(getThingPos(cid),2)      
         return false       
      end    

       if getTilePzInfo(getCreaturePosition(cid)) then       
         doPlayerSendCancel(cid,"Esse monstro nao pode ser sumonado em protect zone!.")       
         return TRUE       
      end    
 
if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, 6,"Voce so pode sumonar seu pet novamente em " .. 
(getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return true
end 
storage = 11548
if #getCreatureSummons(cid) >= 1 then
  return doPlayerSendCancel(cid,"Voce ja chamou seu pet!")
        end
 
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
return true
end
 
 
local summons = getCreatureSummons(cid)
local pet = {
["Wolf lvl 1"] = {1,150},
["Wolf lvl 2"] = {151,250},
["Wolf lvl 3"] = {251,350},
["Wolf lvl 4"] = {351,450},
["Wolf lvl 5"] = {451,550},
["Wolf lvl 6"] = {551,650},
["Wolf lvl 7"] = {651,10000}
}


for k,v in pairs(pet) do -- 1
 
 
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,11548,os.time()+30)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
 
 
end
return true
end

Poke X Ice

avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 16/11/16Posts: 215Gênero: Masculino

Achei esse erro dentro do script:

Spoiler

soSendMagicEffect(getThingPos(cid),2)    

 

correto:

Spoiler

doSendMagicEffect(getThingPos(cid),2)    

 

Thow

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/08/07Posts: 4
1 hora atrás, Poke X Ice disse:

Achei esse erro dentro do script:

  Mostrar conteúdo oculto

soSendMagicEffect(getThingPos(cid),2)    

 

correto:

  Mostrar conteúdo oculto

doSendMagicEffect(getThingPos(cid),2)    

 

Corrigi aqui, muito obrigado amigo !

lazarocp

avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 17/01/12Posts: 236Gênero: Masculino
local vocs_id = {3,7}

function onUse(cid, item, frompos, item2, topos)
      if not isInArray(vocs_id,getPlayerVocation(cid)) then       
         doPlayerSendCancel(cid,"Sua vocacao nao pode summonar esse pet.")   
         doSendMagicEffect(getThingPos(cid),2)      
         return false       
      end    

       if getTilePzInfo(getCreaturePosition(cid)) then       
         doPlayerSendCancel(cid,"Esse monstro nao pode ser sumonado em protect zone!.")       
         return TRUE       
      end 

if #getCreatureSummons(cid) >= 1 then
  local pet = getCreatureSummons(cid)[1]
  doRemoveCreature(pet)
  return doPlayerSendCancel(cid,"Voce removeu seu pet!")
end	  
 
if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, 6,"Voce so pode sumonar seu pet novamente em " .. 
(getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return true
end 
storage = 11548
 
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
return true
end
 
 
local summons = getCreatureSummons(cid)
local pet = {
["Wolf lvl 1"] = {1,150},
["Wolf lvl 2"] = {151,250},
["Wolf lvl 3"] = {251,350},
["Wolf lvl 4"] = {351,450},
["Wolf lvl 5"] = {451,550},
["Wolf lvl 6"] = {551,650},
["Wolf lvl 7"] = {651,10000}
}


for k,v in pairs(pet) do -- 1
 
 
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,11548,os.time()+30)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
 
 
end
return true
end

Tenta assim.

A morte espera todos nos ,apenas aguardamos ela tentando ser felizes,mais quando não conseguimos ser felizes é o mesmo que morrer com a única solução é a morte

becyuw.jpg

Thow

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/08/07Posts: 4
18 horas atrás, lazarocp disse:
local vocs_id = {3,7}

function onUse(cid, item, frompos, item2, topos)
      if not isInArray(vocs_id,getPlayerVocation(cid)) then       
         doPlayerSendCancel(cid,"Sua vocacao nao pode summonar esse pet.")   
         doSendMagicEffect(getThingPos(cid),2)      
         return false       
      end    

       if getTilePzInfo(getCreaturePosition(cid)) then       
         doPlayerSendCancel(cid,"Esse monstro nao pode ser sumonado em protect zone!.")       
         return TRUE       
      end 

if #getCreatureSummons(cid) >= 1 then
  local pet = getCreatureSummons(cid)[1]
  doRemoveCreature(pet)
  return doPlayerSendCancel(cid,"Voce removeu seu pet!")
end	  
 
if (getPlayerStorageValue(cid, 11548) >= os.time()) then
doPlayerSendTextMessage(cid, 6,"Voce so pode sumonar seu pet novamente em " .. 
(getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
return true
end 
storage = 11548
 
if getPlayerStorageValue(cid,storsol) == 1 then
local z = getCreatureSummons(cid)[1]
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
return true
end
 
 
local summons = getCreatureSummons(cid)
local pet = {
["Wolf lvl 1"] = {1,150},
["Wolf lvl 2"] = {151,250},
["Wolf lvl 3"] = {251,350},
["Wolf lvl 4"] = {351,450},
["Wolf lvl 5"] = {451,550},
["Wolf lvl 6"] = {551,650},
["Wolf lvl 7"] = {651,10000}
}


for k,v in pairs(pet) do -- 1
 
 
if getPlayerStorageValue(cid,storsol) < 1 then
if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
if (table.maxn(summons) < 1)then -- 3
x = doSummonCreature(k, getCreaturePosition(cid))
doConvinceCreature(cid, x)
setPlayerStorageValue(cid,11548,os.time()+30)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)
end
end
end
 
 
end
return true
end

Tenta assim.

Nossa irmão, funcionou certinho!!!

 

Muito obrigado !!!

 

Deixa eu perguntar só mais uma coisa, tipo quando eu uso o pet e subo uma escada ele fica la moscando e não me segue :( seria possível algum script que fizesse ele teleportar junto quando subisse escada, quando eu entrar em um teleport ou ficar muito longe dele, tipo um pokemon mesmo hahaha

 

Se não for possivel de buenas, muito obrigado tmj !