Olá amigos do xtbia! Fiz 1 NPC chamado Advogado, no qual, você pode sair da cadeia por 10k. Uma coisa muito facil para se fazer.
Mãos na massa companheiros!!
1º passo - Vá na pasta "Npc" localizada na pasta data copie 1 arquivo .xml e renomeie para "Advogado".
Clique nele com o botão direito e a seguir clique em editar. Apague oque está escrito e ponha isso:
<?xml version="1.0"?><npc name="Advogado" script="data/npc/scripts/advogado.lua" access="3" lookdir="2">
<mana now="0" max="0"/>
<health now="150" max="150"/>
<look type="134" head="95" body="22" legs="10" feet="95"/>
</npc>
2º passo -entre na pasta "scripts" localizada dentro da pasta "Npc" mesmo.. :pinch: Faça 1 copia de qualquer arquivo .lua e renomeie para "advogado".
Clique nele com o botão direito e a seguir clique em editar. Apague oque está escrito e ponha isso:
focus = 0talk_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('Vaza Delinquente')
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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('' .. creatureGetName(cid) .. ' Oi so um advogado muito bom posso te tirar num piscar de olhos por 10k!! vai querer??')
focus = cid
talk_start = os.clock()
end
if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Pera ' .. creatureGetName(cid) .. 'Perae!')
end
if msgcontains(msg, 'sim') and focus == cid then
if pay(cid,10000) then
selfSay('Valeu pela grana otário')
selfSay('/U 5794617 '.. creatureGetName(cid) .. '')
focus = 0
talk_start = 0
else
selfSay('Ow pobre ######, qndo você tiver 10k vem falar cumigo.. VAZAAAAAAAAA!!')
talk_start = os.clock()
end
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
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('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
OBS** Para ajustar o lugar para onde o player deve ir é só arrumar onde está em amarelo.
Aí no exemplo está o lugar x=579 y=461 z=7.. escolha qualquer otro a sua escolha.. apenas tire o espaço entre eles e ficará assim: 5794617
PRONTO AGORA VC TEM SEU PROPRIO NPC ADVOGADO...FAÇA BOM USO.
OBS** EU QUE FIZ!! É MUITO FACIL COM BASE NESSE CRIE O SEU !!
FLWS GENTE!!
EU ODEIO O ANDRÉ!!