Postado Setembro 30, 2017 7 anos Bom pessoal é o seguinte, estou com script de pet no meu servidor. Fiz uma nova vocação (summoner) que vai usar como base o pet system, porem para invocar o pet, é necessario clicar no "Pet Doll". Porem todo mundo que clicar no "pet doll" acaba invocando o pet, eu não quero isso, quero que apenas a vocação nova possa invocar o pet, alguem pode me ajudar? Meu script: Mostrar conteúdo oculto function onUse(cid, item, frompos, item2, topos) 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,"Por medidas de segurança você só pode utilizar este comando em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.") return true end storage = 11548 if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid,"Voce nao pode ter summons para batalhar!") 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 = { ["Old Dragon"] = {1,54}, ["Malagueta"] = {55,59}, ["Frozen Dragon"] = {60,64}, ["Pharma"] = {65,70}, ["infernatil"] = {150,10}, } 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()+5) doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2) end end end end return true end
Postado Setembro 30, 2017 7 anos Solução Pronto. Mostrar conteúdo oculto local vocs_id = {7,9} function onUse(cid, item, frompos, item2, topos) if not isInArray(vocs_id,getPlayerVocation(cid)) then doPlayerSendCancel(cid,"Sua vocação não pode summonar um 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,"Por medidas de segurança você só pode utilizar este comando em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.") return true end storage = 11548 if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid,"Voce nao pode ter summons para batalhar!") 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 = { ["Old Dragon"] = {1,54}, ["Malagueta"] = {55,59}, ["Frozen Dragon"] = {60,64}, ["Pharma"] = {65,70}, ["infernatil"] = {150,10}, } 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()+5) doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2) end end end end return true end Em vocs_id vc deixa as vocações que poderão usar a doll, no caso deixei 7 e 9, mas se for só uma é só deixar 1 lá, ex: local vocs_id = {7} Editado Setembro 30, 2017 7 anos por antharaz (veja o histórico de edições)
Postado Setembro 30, 2017 7 anos Autor Funcionou perfeitamente !! Muito obrigado senhor @antharaz Rep +
Postado Setembro 30, 2017 7 anos Em 30/09/2017 em 22:32, antharaz disse: Pronto. Mostrar conteúdo oculto Mostrar conteúdo oculto local vocs_id = {7,9} function onUse(cid, item, frompos, item2, topos) if not isInArray(vocs_id,getPlayerVocation(cid)) then doPlayerSendCancel(cid,"Sua vocação não pode summonar um 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,"Por medidas de segurança você só pode utilizar este comando em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.") return true end storage = 11548 if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid,"Voce nao pode ter summons para batalhar!") 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 = { ["Old Dragon"] = {1,54}, ["Malagueta"] = {55,59}, ["Frozen Dragon"] = {60,64}, ["Pharma"] = {65,70}, ["infernatil"] = {150,10}, } 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()+5) doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2) end end end end return true end Em vocs_id vc deixa as vocações que poderão usar a doll, no caso deixei 7 e 9, mas se for só uma é só deixar 1 lá, ex: local vocs_id = {7} @antharaz tu tem facebook mano?
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.