agora va em data/npc/scripts abra um akivo e apague oq está dentro e digite:
focus = 0
talk_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('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) .. '! Do you want to hear about the Rules?')
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, 'yes') then
selfSay('Right. Do you want to hear about "Name" Rules,"Talking" Rules or "Game" Rules?')
elseif msgcontains(msg, 'name') then
selfSay('É Proibido: 1)Nomes ofensivos; 2)Nomes com partes de sentenças; 3)Nomes com formado inválido;')
elseif msgcontains(msg, 'talking') then
selfSay('É Proibido: 1)Frases ofensivas; 2)Spam; 3)Anúncio de produtos,servidores,sites,etc.; 3)Qualquer envolvimento em dinheiro; 4)Xingamentos em geral; 5)Calúnia contra um GM ou GOD.')
elseif msgcontains(msg, 'game') then
selfSay('É Proibido: 1)Abusar de Bug, para prejudicamento do server; 2)Usar software não-oficial; 3)Quaisquer Métodos de Hackeamento; 4)Multiclients; 5)Trocas de accounts; 6)Divisão de accounts; 7)Insistência com GODs e GMs;')
elseif string.find(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()
if (os.clock() - talk_start) > 20 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
save como rules.lua
Vc pode traduzir,modificar as falas bote conforme seu gosto.
info
Grupo: Campones
Registrado: 24/11/07
Posts: 5
Reputação: 0
Char no Tibia: ADM Theloy
Ajuda mt a galera q quer botar um npc q fala as regras.N vi esse npc aki no forum entaum me corrijam se ja tiver.
ai vai:
vá até data/npc e abra o bloco de notas e coloue isso:
save como Assistente do Server.xml
agora va em data/npc/scripts abra um akivo e apague oq está dentro e digite:
focus = 0 talk_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('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) .. '! Do you want to hear about the Rules?') 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, 'yes') then selfSay('Right. Do you want to hear about "Name" Rules,"Talking" Rules or "Game" Rules?') elseif msgcontains(msg, 'name') then selfSay('É Proibido: 1)Nomes ofensivos; 2)Nomes com partes de sentenças; 3)Nomes com formado inválido;') elseif msgcontains(msg, 'talking') then selfSay('É Proibido: 1)Frases ofensivas; 2)Spam; 3)Anúncio de produtos,servidores,sites,etc.; 3)Qualquer envolvimento em dinheiro; 4)Xingamentos em geral; 5)Calúnia contra um GM ou GOD.') elseif msgcontains(msg, 'game') then selfSay('É Proibido: 1)Abusar de Bug, para prejudicamento do server; 2)Usar software não-oficial; 3)Quaisquer Métodos de Hackeamento; 4)Multiclients; 5)Trocas de accounts; 6)Divisão de accounts; 7)Insistência com GODs e GMs;') elseif string.find(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() if (os.clock() - talk_start) > 20 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 endsave como rules.lua
Vc pode traduzir,modificar as falas bote conforme seu gosto.