Desculpem ae estar postando novamente mas é que minhas duvidas continuam a vir xP
este é outro script que eu fiz mas novamente da erro <eof>
já mudei ele varias vezes e continua ñ sei mais oque fazer, se alguem puder dar uma olhada e me dizer onde falhei agradeço muito.
Script:>
focus = 0talk_start = 0
target = 0
following = false
attacking = false
talk_state = 20
cname = ''
vocation = 0
mainlevel = 400
gstat = 0 -- guild status
grank = '' -- guild rank
gname = '' -- guild name
pname = '' -- name of some other player
maxnamelen = 30
maxranklen = 20
maxnicklen = 20
leaderlevel = 50
NONE = 0
INVITED = 1
MEMBER = 2
VICE = 3
leader = 4
allow_pattern = '^[a-zA-Z0-9 -]+$'
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Bye.')
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)
cname = creatureGetName(cid)
msg = string.lower(msg)
end
if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
if getPlayerSex(cid) == 1 or getPlayerSex(cid) == 2 or getPlayerSex(cid) == 17 or getPlayerSex(cid) == 18 or getPlayerSex(cid) == 19 or getPlayerSex(cid) == 20 then
selfSay('Hello, ' .. creatureGetName(cid) .. '! So, you want to get in the Akatsuki?')
talk_state = 20
focus = cid
talk_start = os.clock()
else
selfSay('Sorry, but you alredy chose your position. If not, talk to the Admin.')
talk_state = 0
focus = cid
end
end
elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. cname .. '! I talk to you in a minute.')
elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Cya, ' .. cname .. '!')
talk_state = 20
focus = 0
talk_start = 0 elseif focus == cid then
talk_start = os.clock()
if talk_state == 20 then
if msgcontains(msg, 'yes') then -- confirmando decisao
level = getPlayerLevel(cname)
end
end
end
end
if level >= mainlevel then
selfSay('Great! tell me what member you want to be?')
talk_state = 1
else
selfSay('Sorry, you don\'t have all the requeriments to be one Akatsuki member...')
talk_state = 20
else
selfSay('So, come back when you have level '.. mainlevel ..'.')
talk_state = 20
end
end
end
elseif talk_state == 1 then -- telling vilage
talk_state = 2
if msgcontains(msg, 'pain') then
selfSay('hum, kill the monster named pain and bring to me his rune. if you have the rune say: pain rune')
talk_state = 2
elseif msgcontains(msg, 'konan') then
selfSay('hum, kill the monster named konan and bring to me his rune. if you have the rune say: konan rune')
talk_state = 2
elseif msgcontains(msg, 'hidan') then
selfSay('hum, kill the monster named hidan and bring to me his rune. if you have the rune say: hidan rune')
talk_state = 2
elseif msgcontains(msg, 'tobi') then
selfSay('hum, kill the monster named tobi and bring to me his rune. if you have the rune say: tobi rune')
talk_state = 2
elseif msgcontains(msg, 'zetsu') then
selfSay('hum, kill the monster named zetsu and bring to me his rune. if you have the rune say zetsu rune')
talk_state = 2
elseif msgcontains(msg, 'sasori') then
selfSay('hum, kill the monster named sasori and bring to me his rune. if you have the rune say sasori rune')
talk_state = 2
elseif msgcontains(msg, 'deidara') then
selfSay('hum, kill the monster named deidara and bring to me his rune. if you have the rune say deidara rune')
talk_state = 2
elseif msgcontains(msg, 'itachi') then
selfSay('hum, kill the monster named itachi and bring to me his rune. if you have the rune say itachi rune')
talk_state = 2
elseif msgcontains(msg, 'kisame') then
selfSay('hum, kill the monster named kisame and bring to me his rune. if you have the rune say kisame rune')
talk_state = 2
end
elseif msgcontains(msg, 'kakuzu') then
selfSay('hum, kill the monster named kakuzu and bring to me his rune. if you have the rune say kakuzu rune')
talk_state = 2
else
selfSay('Sorry, this member does not exist')
vocation = 3
talk_state = 1
end
elseif talk_state == 2 then -- telling vilage
if msgcontains(msg, 'pain rune') then
selfSay('Very good, let me take the rune! are you sure?')
itemstatus = doPlayerRemoveItem(cid,2294)
talk_state = 4
end
elseif msgcontains(msg, 'konan rune') then
selfSay('Very good, let me take the rune! are you sure?')
itemstatus = doPlayerRemoveItem(cid,2295)
talk_state = 6
end
elseif msgcontains(msg, 'hidan rune') then
selfSay('Right your son of the b---! are you sure?')
itemstatus = doPlayerRemoveItem(cid,2296)
talk_state = 7
end
elseif msgcontains(msg, 'tobi rune') then
selfSay('I\'m with hunger, get out of here! are you sure?')
itemstatus = doPlayerRemoveItem(cid,2297)
talk_state = 5
end
elseif msgcontains(msg, 'zetsu rune') then
selfSay('Get out of here! are you sure?')
itemstatus = doPlayerRemoveItem(cid,2299)
talk_state = 8
end
elseif msgcontains(msg, 'sasori rune') then
selfSay('Oh my God! You\'ll be and master killer! are you sure')
itemstatus = doPlayerRemoveItem(cid,2299)
talk_state = 9
end
elseif msgcontains(msg, 'deidara rune') then
selfSay('Hmm, i going put fire in your ass! get out of here! are you sure?')
itemstatus = doPlayerRemoveItem(cid,2304)
talk_state = 10
end
elseif msgcontains(msg, 'itachi rune') then
selfSay('Humm, Mangekyou Sharingan! don\'t worry i\'m just kidding! are you sure?')
itemstatus = doPlayerRemoveItem(cid,2306)
talk_state = 11
end
elseif msgcontains(msg, 'kisame rune') then
selfSay('Humm... are you sure?')
itemstatus = doPlayerRemoveItem(cid,2309)
talk_state = 12
end
elseif msgcontains(msg, 'kakuzu rune') then
selfSay('
! are you sure?')
itemstatus = doPlayerRemoveItem(cid,2312)
talk_state = 13
end
else
selfSay('Sorry, this clan does not exists.')
vocation = 0
talk_state = 2
end
elseif talk_state == 4 then -- confirming vocation
if msgcontains(msg, 'yes') and talk_state == 4 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7845,1)
setPlayerStorageValue(cid,50,1)
learnSpell(cid,'mar de areia',0)
learnSpell(cid,'akatsuki final rinnegan no jutsu',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
learnSpell(cid,'rinnegan',0)
selfSay('Here is your new habilities.')
selfSay('mar de areia, akatsuki final rinnegan no jutsu, akat impulse, akatsuki no jutsu and rinnegan.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 161')
talk_state = 20
focus = 0
end
end
if talk_state == 5 then
if msgcontains(msg, 'yes') and talk_state == 5 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7846,1)
setPlayerStorageValue(cid,51,1)
learnSpell(cid,'dragao de chakra',0)
learnSpell(cid,'suiton tsunami no jutsu',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
selfSay('Here is your new habilities.')
selfSay('dragao de chakra, suiton tsunami no jutsu, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 168')
talk_state = 20
focus = 0
end
end
if talk_state == 6 then
if msgcontains(msg, 'yes') and talk_state == 6 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7847,1)
setPlayerStorageValue(cid,52,1)
selfSay('Here is your new habilities.')
selfSay('ritual jashin, sugakra, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 170')
learnSpell(cid,'ritual jashin',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
learnSpell(cid,'sugakra',0)
talk_state = 20
focus = 0
end
end
if talk_state == 7 then
if msgcontains(msg, 'yes') and talk_state == 7 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7848,1)
setPlayerStorageValue(cid,53,1)
selfSay('Here is your new habilities.')
selfSay('amaterasu, katon karyuudan, mangekyou sharingan, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 164')
learnSpell(cid,'amaterasu',0)
learnSpell(cid,'katon karyuudan',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
learnSpell(cid,'mangekyou sharingan',0)
talk_state = 20
focus = 0
end
end
if talk_state == 8 then
if msgcontains(msg, 'yes') and talk_state == 8 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7849,1)
setPlayerStorageValue(cid,54,1)
learnSpell(cid,'camuflate',0)
learnSpell(cid,'zetsu gan no jutsu',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
learnSpell(cid,'corda de mil metros',0)
selfSay('Here is your new habilities.')
selfSay('camuflate, zetsu gan no jutsu, corda de mil metros, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 169.')
talk_state = 20
focus = 0
end
end
if talk_state == 9 then
if msgcontains(msg, 'yes') and talk_state == 9 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7850,1)
setPlayerStorageValue(cid,55,1)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
learnSpell(cid,'sabaku sousou',0)
learnSpell(cid,'corda de mil metros',0)
selfSay('Here is your new habilities.')
selfSay('sabaku sousou, corda de mil metros, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 162.')
talk_state = 20
focus = 0
end
end
if talk_state == 10 then
if msgcontains(msg, 'yes') and talk_state == 10 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7851,1)
setPlayerStorageValue(cid,56,1)
learnSpell(cid,'big explosion',0)
learnSpell(cid,'katsu',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
selfSay('big explosion, katsu, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 165.')
talk_state = 20
focus = 0
end
end
if talk_state == 11 then
if msgcontains(msg, 'yes') and talk_state == 11 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7852,1)
setPlayerStorageValue(cid,57,1)
learnSpell(cid,'amaterasu',0)
learnSpell(cid,'katon karyuudan',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
learnSpell(cid,'mangekyou sharingan',0)
selfSay('Here is your new habilities.')
selfSay('amaterasu, katon karyuudan, mangekyou sharingan, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 167.')
talk_state = 20
focus = 0
end
end
if talk_state == 12 then
if msgcontains(msg, 'yes') and talk_state == 12 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7853,1)
setPlayerStorageValue(cid,58,1)
learnSpell(cid,'tubarchakra',0)
learnSpell(cid,'sugakra',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
selfSay('Here is your new habilities.')
selfSay('tubarchakra, sugakra, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 166.')
talk_state = 20
focus = 0
end
end
if talk_state == 13 then
if msgcontains(msg, 'yes') and talk_state == 13 then
buy(cid,6227,1,0)
buy(cid,6272,1,0)
buy(cid,2195,1,0)
setPlayerStorageValue(cid,7854,1)
setPlayerStorageValue(cid,59,1)
learnSpell(cid,'chidori nagashi',0)
learnSpell(cid,'cruzadajutsu',0)
learnSpell(cid,'akat impulse',0)
learnSpell(cid,'akatsuki no jutsu',0)
learnSpell(cid,'kazeno tzul',0)
selfSay('Here is your new habilities.')
selfSay('chidori nagashi, cruzadajutsu,kazeno tzul, akat impulse and akatsuki no jutsu.')
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 163.')
talk_state = 20
focus = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if focus > 0 then
x, y, z = creatureGetPosition(focus)
myx, myy, myz = selfGetPosition()
if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then
selfTurn(0)
end
if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then
selfTurn(2)
end
if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then
selfTurn(1)
end
if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then
selfTurn(3)
end
if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(1)
end
if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(3)
end
if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(2)
end
if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(0)
end
if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(1)
end
if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(3)
end
if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(2)
end
if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(0)
end
if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(1)
end
if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(3)
end
if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(2)
end
if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(0)
end
end
if focus == 0 then
randmove = math.random(1,50)
if randmove == 1 then
selfMove(0)
end
if randmove == 2 then
selfMove(1)
end
if randmove == 3 then
selfMove(2)
end
if randmove == 4 then
selfMove(3)
end
end
if (os.clock() - talk_start) > 45 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
end
end