@All
Eu consigui +/- o npc da saffari, tipow ta assim o saffari.lua
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
local saffari = {x=1145, y=1411, z=7}
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('Olá Eu posso deixa-lo entrar na Saffari Zone por um preço de 3000 Dollars, Aceita?')
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 then
selfSay('Você não pode entrar na saffari portando Pokeballs para catch. Até logo.')
focus = 0
talk_start = 0
elseif getPlayerItemCount(cid,2152) < 30 and getPlayerItemCount(cid,2160) < 1 then
selfSay('Você não possui dinheiro suficiente. Até logo.')
focus = 0
talk_start = 0
elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >=1 then
selfSay('Você Já está na saffari.')
focus = 0
talk_start = 0
else
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 2144, 30)
doPlayerRemoveMoney(cid, 300000)
doTeleportThing(cid, saffari)
talk_start = os.clock()
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
ai eu nao tinha a ball da saffari, ai eu pensei , saffari ball é a mesma coisa de great ai coloquei o id da great ball no lugar do da saffari.
setPlayerStorageValue(cid, 98796, 1) setPlayerStorageValue(cid, 98797, 1) doPlayerAddItem(cid, 2391, 30) doPlayerRemoveMoney(cid, 300000) doTeleportThing(cid, saffari) talk_start = os.clock() end
Obs: o id é 2391 (great ball)
só que depois nunca mais iria poder entrar na saffari denovo, pq o npc entende que eu ainda nao gastei as 30 saffari ball,
emfim queria botar esse npc pra me expulsar da saffari qnd desse 30 minutos.
Oq eu faço?









info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino
@matadorzim
pare de FLOODAR!
@pedrowarlock
o problema de fazer isso eh q tem coisas q funcionam usando a mana como base... n tem nd a ver com o client ;/
fico lgl sim.. soh q editar tanta img assim eh foda.. ;/ vo tentar por label aki amanha e ver como fica...