Não Sei Mais O Que Fazeeer!

fnd13
Por fnd13
em Scripts

fnd13

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/09/07Posts: 7

Gente por favor...

Tanto em alguns NPCs que vendem ADDONs

Quanto nos capitães de barcos, eu chego e falo:

HI

O capitão responde

Hello, PLAYER...

 

Ai se eu falo por exemplo

Aramunhra (nome de uma cidade)

Ele não responde e sai no .exe essa linha:

Semttulo-1.jpg

 

 

Esse é o script:

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

end

 

 

function onCreatureAppear(creature)

 

end

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye then.')

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

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

if getPlayerPremium(cid) then

 

selfSay('Welcome ' .. creatureGetName(cid) .. '! I can take you to Aramunhra (250gps), Livingstar (220gps), Molour (200gps), Menutis (250gps), Seruse Bay (300gps), Amazonia (330gps) and that the hellish world of Draconia! (520gps)... Where do you want to go?')

focus = cid

talk_start = os.clock()

 

else

selfSay('Sorry, only premium players can travel by boat.')

focus = 0

talk_start = 0

end

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

 

if msgcontains(msg, 'aramunhra') and focus == cid then

if pay(cid,250) then

selfSay('Let\'s go!')

travel(cid, 1080, 488, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'livingstar') and focus == cid then

if pay(cid,220) then

selfSay('Let\'s go!')

travel(cid, 1483, 2834, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'molour') and focus == cid then

if pay(cid,200) then

selfSay('Let\'s go!')

travel(cid, 732, 640, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'menutis') and focus == cid then

if pay(cid,250) then

selfSay('Let\'s go!')

travel(cid, 1608, 470, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'seruse bay') and focus == cid then

if pay(cid,300) then

selfSay('Let\'s go!')

travel(cid, 1532, 1012, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'amazonia') and focus == cid then

if pay(cid,330) then

selfSay('Let\'s go!')

travel(cid, 1137, 880, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'ice island') and focus == cid then

if pay(cid,480) then

selfSay('Let\'s go!')

travel(cid, 1521, 1380, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'draconia') and focus == cid then

if pay(cid,520) then

selfSay('Let\'s go!')

travel(cid, 781, 181, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'evento') and focus == cid then

if pay(cid,100) then

selfSay('Let\'s go!')

travel(cid, 649, 361, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

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

 

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

 

Zmovir

Shadow Worlds rpg
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 28/09/10Posts: 237

tenta esse

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

end

 

 

function onCreatureAppear(creature)

 

end

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye then.')

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

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

if getPlayerPremiumDays(cid) then

 

selfSay('Welcome ' .. creatureGetName(cid) .. '! I can take you to Aramunhra (250gps), Livingstar (220gps), Molour (200gps), Menutis (250gps), Seruse Bay (300gps), Amazonia (330gps) and that the hellish world of Draconia! (520gps)... Where do you want to go?')

focus = cid

talk_start = os.clock()

 

else

selfSay('Sorry, only premium players can travel by boat.')

focus = 0

talk_start = 0

end

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

 

if msgcontains(msg, 'aramunhra') and focus == cid then

if pay(cid,250) then

selfSay('Let\'s go!')

travel(cid, 1080, 488, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'livingstar') and focus == cid then

if pay(cid,220) then

selfSay('Let\'s go!')

travel(cid, 1483, 2834, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'molour') and focus == cid then

if pay(cid,200) then

selfSay('Let\'s go!')

travel(cid, 732, 640, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'menutis') and focus == cid then

if pay(cid,250) then

selfSay('Let\'s go!')

travel(cid, 1608, 470, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'seruse bay') and focus == cid then

if pay(cid,300) then

selfSay('Let\'s go!')

travel(cid, 1532, 1012, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'amazonia') and focus == cid then

if pay(cid,330) then

selfSay('Let\'s go!')

travel(cid, 1137, 880, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'ice island') and focus == cid then

if pay(cid,480) then

selfSay('Let\'s go!')

travel(cid, 1521, 1380, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'draconia') and focus == cid then

if pay(cid,520) then

selfSay('Let\'s go!')

travel(cid, 781, 181, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

talk_start = os.clock()

end

end

if msgcontains(msg, 'evento') and focus == cid then

if pay(cid,100) then

selfSay('Let\'s go!')

travel(cid, 649, 361, 6)

focus = 0

talk_start = 0

else

selfSay('Sorry, you don\'t have enough money.')

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

 

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

Conheça o shadow worlds clique na imagen

xd9c6.jpg

 

 

 

Metas:

 

Ter uma meta [x]

 

fnd13

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/09/07Posts: 7

Gente, obrigado pelo interesse de vcs ao tentar ajudar.

 

Mais agora ele nem ao meu HI responde.

Continua aparecendo as mesmas mensagens no console

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: Warrior of Mort

fnd13

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/09/07Posts: 7

Visconde, deu certo cara! Valeu..

. RIP +1

 

Porém, agora ele só fala:

Captain Murdok: Sorry, only premium players can travel by boat.

 

Mesmo o jogador tendo Premium Account!

Na realidade gostaria que algumas cidades fossem vips, e outras free

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: Warrior of Mort

tenta assim, nem testei:

 

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
local citypremium = { "Aramunhra", "Livingstar", "Molour", "Menutis" } -- nome das cidades que precisa ser premium para viajar

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
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

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Welcome ' .. creatureGetName(cid) .. '! I can take you to Aramunhra (250gps), Livingstar (220gps), Molour (200gps), Menutis (250gps), Seruse Bay (300gps), Amazonia (330gps) and that the hellish world of Draconia! (520gps)... Where do you want to go?')
focus = cid
talk_start = os.clock()


elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

elseif focus == cid then
talk_start = os.clock()

for i=1, #citypremium do
if msgcontains(msg, tostring(citypremium[i])) and focus == cid then
if isPremium(cid) == false then
	selfSay('Sorry, only premium players can travel to city.')
	focus = 0
	talk_start = 0
end
end
end

if msgcontains(msg, 'aramunhra') and focus == cid then
if pay(cid,250) then
selfSay('Let\'s go!')
travel(cid, 1080, 488, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'livingstar') and focus == cid then
if pay(cid,220) then
selfSay('Let\'s go!')
travel(cid, 1483, 2834, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'molour') and focus == cid then
if pay(cid,200) then
selfSay('Let\'s go!')
travel(cid, 732, 640, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'menutis') and focus == cid then
if pay(cid,250) then
selfSay('Let\'s go!')
travel(cid, 1608, 470, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'seruse bay') and focus == cid then
if pay(cid,300) then
selfSay('Let\'s go!')
travel(cid, 1532, 1012, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'amazonia') and focus == cid then
if pay(cid,330) then
selfSay('Let\'s go!')
travel(cid, 1137, 880, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'ice island') and focus == cid then
if pay(cid,480) then
selfSay('Let\'s go!')
travel(cid, 1521, 1380, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'draconia') and focus == cid then
if pay(cid,520) then
selfSay('Let\'s go!')
travel(cid, 781, 181, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
talk_start = os.clock()
end
end
if msgcontains(msg, 'evento') and focus == cid then
if pay(cid,100) then
selfSay('Let\'s go!')
travel(cid, 649, 361, 6)
focus = 0
talk_start = 0
else
selfSay('Sorry, you don\'t have enough money.')
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

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

fnd13

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/09/07Posts: 7

Opa, testei aqui ele pelo menos respondeu meu HI.

Mais depois apareceu esse erro aqui:

boatnew.lua:32: bad argument #2 to 'find' <string expected, got...>

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: Warrior of Mort

fnd13

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/09/07Posts: 7

Jhon!

Agora sim meu caro...

 

Deu certinho!

Parabens, valeu cara!

 

Só que tenho outro pequeno probleminha,,,

Quero fazer quests para addons, ou seja, o jogador junta 100 chicken feathers, 50 minotars leathers e etc...

E coloca-os em cima de um recipiente, do lado do recipiente existe uma pedra, ele da USE na pedra e recebe o addon.

O outfit farei por quest mais dificeis, porém os addons por lugares espalhados no mapa.

 

Gostaria de saber se vc tem esses moviments e tals, para eu habilitar no meu!

Valeeeeeeu doutor!