TH

Addons Bugados? Saiba Como Conserta-los!

Por thayam, 18 de set. de 2007 em Tutoriais de Scripting

script
28
6k
thayamT
18 de setembro de 2007 às 21:26

Aow pessoas olha eu aqui de novo

Bom seguinte, em alguns OTs os addons estão com problema, saiba aqui como conserta-los

 

Vamos ao Tuto

 

1º que não sao os addons q estão bugados... mas sim o npc Varkhal

 

abra a pasta data\npc\script e abra o arkivo addon

ele estará assim:

 

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 (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Hello ' .. creatureGetName(cid) .. '! I sell the first addon for 5k and the second addon for 10k.')

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()

 

if msgcontains(msg, 'first addon') then

selfSay('Do you want to buy the first addon for 5k?')

talk_state = 1

 

elseif msgcontains(msg, 'second addon') then

selfSay('Do you want to buy the second addon for 10k?')

talk_state = 2

 

elseif talk_state == 1 then

if msgcontains(msg, 'yes') then

if pay(cid,5000) then

addon(cid, 1)

else

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

end

end

talk_state = 0

 

elseif talk_state == 2 then

if msgcontains(msg, 'yes') then

if pay(cid,10000) then

addon(cid, 2)

else

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

end

end

talk_state = 0

 

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

doNpcSetCreatureFocus(focus)

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

 

Bom este é o Tutorial, espero ter ajudado

 

POR FAVOR COMENTEM, SUA OPNIÃO É MUITO IMPORTANTE PARA MIM!!!

Editado Setembro 20 por thayam

DreniusD
18 de setembro de 2007 às 22:06

:blink: , finalmente alguem posto um tuto de addons, lembro q eu primo tava p##o com isso, agora que alguem finalmente posto eu vo recomenda pra ele, :p , ty thayam, espero que você continue trazendo tutorials, pq pode ajuda um monte de mlk, incrusive eu :D

thayamT
18 de setembro de 2007 às 22:07
:blink: , finalmente alguem posto um tuto de addons, lembro q eu primo tava p##o com isso, agora que alguem finalmente posto eu vo recomenda pra ele, :p , ty thayam, espero que você continue trazendo tutorials, pq pode ajuda um monte de mlk, incrusive eu :D

 

#Drenius

Valeu Cara, mais uma fez vc comentando nos meus posts, vc está me dando um grande apoio cara

valeu por td

Abraços

Thayam~~

Conde SapoC
19 de setembro de 2007 às 21:42

no lugar de

function onThink()

if (os.clock() - talk_start) > 30 then

 

aconselho por

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then

 

essa instrução doNpcSetCreatureFocus(focus) faz o NPC olhar pro player.

(Quando o player fala "hi")

 

Fora isso

BOM TUTORIAL

 

smile_positivo.gif

DreniusD
19 de setembro de 2007 às 21:48
no lugar de
function onThink()

if (os.clock() - talk_start) > 30 then

 

aconselho por

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then

 

essa instrução doNpcSetCreatureFocus(focus) faz o NPC olhar pro player.

(Quando o player fala "hi")

 

Fora isso

BOM TUTORIAL

 

smile_positivo.gif

 

 

Boa correção cara, eu n tinha percebido antes qd eu li mais agora q vc flo eu vi msm q tava errado:D

 

Inda bem que tem alguns caras q nm vc q prestam atenção nesses detalhes :p ?

 

flws

thayamT
20 de setembro de 2007 às 14:51
no lugar de
function onThink()

if (os.clock() - talk_start) > 30 then

 

aconselho por

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then

 

essa instrução doNpcSetCreatureFocus(focus) faz o NPC olhar pro player.

(Quando o player fala "hi")

 

Fora isso

BOM TUTORIAL

 

Vlw cara

obrigado pela ideia manow

ja arrumei ae

ty abraços

Thayam~~

1 mês depois...
Darth SidiousD
11 de outubro de 2007 às 14:11

Não adiantou nada =/

thayamT
11 de outubro de 2007 às 14:13

//Darth Sidious

Não adiantou nada =/

 

 

Puts cara entao nem sei como vc deve fazer =/

jeguezJ
11 de outubro de 2007 às 15:12

@thayam,

Cara, não funcionou no meu server 8.0, aliás nãoi tá pegando nenhum addon nos OT's 8.0 pelo menos que eu saiba...

Tenta olhar e arrumar o problema dos OT's 8.0, quem sabe você não consiga né? :D

 

Abraço ;)

deco20D
11 de outubro de 2007 às 15:22

Ae Thayam ,

vo dar uma olhada aqui pq meu server ta com esse

bug de action...jaja eu edito

Cya

thayamT
11 de outubro de 2007 às 17:25
@thayam,

Cara, não funcionou no meu server 8.0, aliás nãoi tá pegando nenhum addon nos OT's 8.0 pelo menos que eu saiba...

Tenta olhar e arrumar o problema dos OT's 8.0, quem sabe você não consiga né? :D

 

Abraço ;)

 

Num sei pq nao velhow, aqui em casa funcionou certinho e eu testei com Yurots, devland, lithuim entr outros!

spot123123S
11 de outubro de 2007 às 20:58

#Topic

Muito bom

Testado

Aki Funcionado Perfeitamente!

 

Cya~~

 

//Spot

PoppP
11 de outubro de 2007 às 21:35

Vou mostrar para o Joãozinhú, acho que ele vai ficar interessado :]

Darth SidiousD
11 de outubro de 2007 às 21:35

O problema é no meu distro mas já concertei a parada já

Agora botei addon por items em varios npcs

2 semanas depois...
thayamT
20 de outubro de 2007 às 07:34

//Darth Sidious

Q bom que conseguiu!

flws