Alguem poderia me dizer o pq do meu npc saffari tar tirando do saffari apos jogar 1 ball?
focus = 0
Alguem poderia me dizer o pq do meu npc saffari tar tirando do saffari apos jogar 1 ball?
focus = 0
Tente usar o meu, aqui está normal.
Atenciosamente
Pokerangers
Tente usar o meu, aqui está normal.
focus = 0talk_start = 0target = 0following = falseattacking = falsefunction onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos)if focus == cid thenselfSay('See ya.')focus = 0talk_start = 0endendfunction onCreatureTurn(creature)endfunction msgcontains(txt, str)return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))endfunction onCreatureSay(cid, type, msg)msg = string.lower(msg)if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 3 thenselfSay('Hello, i can let you enter in the saffari zone for 3000 Dollars, do you accept?')focus = cidtalk_start = os.clock()elseif (msgcontains(msg, 'yes') ) thenif getPlayerItemCount(cid,2391) >= 1 or getPlayerItemCount(cid,2394) >= 1 or getPlayerItemCount(cid,2392) >= 1 or getPlayerItemCount(cid,2393) >= 1 thenselfSay("You can't enter in the saffari zone with any type of pokeballs! Cya")focus = 0talk_start = 0elseif getPlayerItemCount(cid,2152) < 30 and getPlayerItemCount(cid,2160) < 1 thenselfSay("You don't have that much of money. Cya")focus = 0talk_start = 0elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >= 1 thenselfSay("You already are in the saffari zone!")focus = 0talk_start = 0elsesetPlayerStorageValue(cid, 98796, 1)setPlayerStorageValue(cid, 98797, 1)doPlayerAddItem(cid, 2391, 30)doPlayerRemoveMoney(cid, 300000)doTeleportThing(cid, SafariEnter)doSendMagicEffect(getThingPos(cid), 21)talk_start = os.clock()endelseif (msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3) thenselfSay('Sorry, Im busy at this moment.')elseif (msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 3) thenselfSay('Good bye then.')focus = 0talk_start = 0endendfunction onCreatureChangeOutfit(creature)endfunction onThink()if (os.clock() - talk_start) > 30 thenif focus > 0 thenselfSay('See ya.')endfocus = 0endend
Continua teleportando para fora apos tacar 1 ball C:
ola amigo, irei tentar ajudar
bom em saffari.lua deleta tudo que tiver la e coloca isso \/
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('See ya.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 3 then
selfSay('Hello, i can let you enter in the saffari zone for 500 Dollars, do you accept?')
focus = cid
talk_start = os.clock()
elseif (msgcontains(msg, 'yes') ) then
if getPlayerItemCount(cid,2391) >= 1 or getPlayerItemCount(cid,2394) >= 1 or getPlayerItemCount(cid,2392) >= 1 or getPlayerItemCount(cid,2393) >= 1 or getPlayerItemCount(cid, 12617) >= 1 then
selfSay("You can't enter in the saffari zone with any type of pokeballs! Cya")
focus = 0
talk_start = 0
elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >= 1 then
selfSay("You already are in the saffari zone!")
focus = 0
talk_start = 0
elseif doPlayerRemoveMoney(cid, 50000) then --500dl --alterado v1.9
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 12617, 30) --alterado v1.9
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
else
selfSay("You don't have that much of money. Cya") --alterado v1.9
focus = 0
talk_start = 0
end
elseif (msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3) then
selfSay('Sorry, Im busy at this moment.')
elseif (msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 3) then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('See ya.')
end
focus = 0
end
end
e no npc leila.xml deixe assim \/
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>
assim esta igual o meu e esta funcionando 100% :>
No configuration,lua,
pode ter algo haver com seu problema
Atenciosamente
Pokerangers
No configuration,lua,
pode ter algo haver com seu problema
SafariEnter = {x=1592, y=1409, z=6}SafariOut = {x = 1368, y = 1300, z = 6}Leila.xml<?xml version="1.0" encoding="UTF-8"?><npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1"><health now="15" max="15"/><look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/><parameters><parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/></parameters></npc>
no configuration são só as cordenadas amigo ^^
No configuration,lua,
pode ter algo haver com seu problema
SafariEnter = {x=1592, y=1409, z=6}SafariOut = {x = 1368, y = 1300, z = 6}Leila.xml<?xml version="1.0" encoding="UTF-8"?><npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1"><health now="15" max="15"/><look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/><parameters><parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/></parameters></npc>
no configuration são só as cordenadas amigo ^^
Sim, eu sei, porem eu tive que arrumar isto no meu servidor,
Eu tinha um problema parecido...
Atenciosamente
Pokerangers
@Snix
bom alterei para great ball e continuou saindo apos 1 ball
@Pokerangers
ai seria para mudar entrada/saida ;c
----
pelo visto esta configurado em algum lugar do pda que se tacar ball que n é saffari é teleportado C:
ve seu arquivo catch.lua e procura por issu
Obrigado jean.
alguem reporta para fechar topico? ;c
Tópico movido para a seção de dúvidas e pedidos resolvidos.
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
"O fracasso é a oportunidade de se começar de novo inteligentemente"