Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Esse script é para trocar o nome do player?

 

parabens pelo script

 

REP+

 

 

Olá, bom muitos vieram pedindo esse script e vou ajudar a vocês de como criar um NPC QUE MUDA NOME DO JOGADOR!

 

 

Está ai descrito no tópico brother, ele muda o nome por gold ou item (configurável).

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

  • Respostas 10
  • Visualizações 2.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado

Olá, bom muitos vieram pedindo esse script e vou ajudar a vocês de como criar um NPC QUE MUDA NOME DO JOGADOR!

 

 

Está ai descrito no tópico brother, ele muda o nome por gold ou item (configurável).

 

Opss.. Desculpa pela minha falta de atenção

Obrg por Dizer

Meus Contatos!

 

Minhas Funções:

 

               Skype: TsplayerT

         Facebook: TakaFukushii

          YouTube: ADoseDupla

           Twitter: @_Splayer_

 

 

 

 

 

 

 

                             Mapper:▓▓▓▓▓▓▓▓▓▓ 97%

     Programmer:▓▓▓▓▓▒▒▒▒▒ 45%

             Scripter:▓▓▓▓▓▓▓▓▓▒ 83%

              Spriter:▓▓▓▓▓▓▒▒▒▒ 57%

    Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99%

        Ot Creator:▓▓▓▓▓▓▓▒▒▒71%

Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%

 

  • 7 months later...
Postado

O tópico foi movido para a área correta, preste mais atenção da próxima vez!

Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680

Este tópico foi movido:

De: "OTServScriptingGeral"

Para: "OTServScriptingMonsters e NPCs"

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

  • 4 weeks later...
Postado

cara no meu server com tfs 1.0

client 8.54

da esse erro:

 

[04/04/2015 17:09:15] [Error - Npc interface] 
[04/04/2015 17:09:15] data/npc/scripts/renamer.lua:onCreatureSay
[04/04/2015 17:09:15] Description: 
[04/04/2015 17:09:15] data/npc/scripts/renamer.lua:65: attempt to index field 'item' (a nil value)
[04/04/2015 17:09:15] stack traceback:
[04/04/2015 17:09:15] data/npc/scripts/renamer.lua:65: in function 'callback'
[04/04/2015 17:09:15] data/npc/lib/npcsystem/npchandler.lua:391: in function 'onCreatureSay'
[04/04/2015 17:09:15] data/npc/scripts/renamer.lua:9: in function <data/npc/scripts/renamer.lua:9>

Meus Contatos!

 

Minhas Funções:

 

               Skype: TsplayerT

         Facebook: TakaFukushii

          YouTube: ADoseDupla

           Twitter: @_Splayer_

 

 

 

 

 

 

 

                             Mapper:▓▓▓▓▓▓▓▓▓▓ 97%

     Programmer:▓▓▓▓▓▒▒▒▒▒ 45%

             Scripter:▓▓▓▓▓▓▓▓▓▒ 83%

              Spriter:▓▓▓▓▓▓▒▒▒▒ 57%

    Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99%

        Ot Creator:▓▓▓▓▓▓▓▒▒▒71%

Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%

 

Postado

Olá, bom muitos vieram pedindo esse script e vou ajudar a vocês de como criar um NPC QUE MUDA NOME DO JOGADOR!

 

Vamos lá primeiro passo abra a pasta data/npcs. crie um arquivo chamado Kemi Change Nick.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Kemi Change Nick" script="renamer.lua" walkinterval="0" floorchange="0">
<health now="150" max="150"/>
<look type="145" head="114" body="119" legs="114" feet="114" corpse="2212" addons="3"/>
    <parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|. Para mudar seu nome diga {nome} nao coloque nick muito grande ou ira bugar."/>
    </parameters>
</npc>

 

Agora abra a pasta scripts . Data/npc/scripts e crie um arquivo chamado renamer.lua

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talk = {}

local name = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end

function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end

function creatureGreetCallback(cid)

talk[cid] = 0

name[cid] = ''

return true

end

local chars = {' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}

RET_VALID = 1

RET_EXISTS = 2

RET_INVALID = 3

local function validName(name)

if getPlayerGUIDByName(name) ~= nil then

return RET_EXISTS

end

for i = 1, name:len() do

if not(isInArray(chars, name:sub(i,i))) then

return RET_INVALID

end

end

return RET_VALID

end

local function getValid(name, opt)

local function tchelper(first, rest)

return first:upper()..rest:lower()

end

return opt and name:gsub("(%a)([%w_']*)", tchelper) or name:gsub("^%l", string.upper)

end

local config = {

type = 'item', -- or 'item'

money = 0, -- = 1cc

everyFirstLetterCapital = false

}

function messageDefaultCallback(cid, type, msg)

if not(npcHandler:isFocused(cid)) then

return false

end

if msgcontains(msg, "nome") and talk[cid] == 0 then

selfSay("Qual deve ser o seu novo nome?", cid)

talk[cid] = 1

elseif talk[cid] == 1 then

local v = getValid(msg:lower(), config.everyFirstLetterCapital)

local ret = validName(v)

if ret == RET_VALID then

selfSay("Então você quer '" .. v .. "' Para ser seu novo nome por " .. (config.type == "money" and (config.money .. " gold") or (config.item[2] .. ' ' .. (config.item[2] > 1 and getItemPluralNameById(config.item[1]) or getItemNameById(config.item[1])))) .. "?", cid)

talk[cid], name[cid] = 2, v

else

if ret == RET_INVALID then

selfSay(msg .. " não é um nome válido. Qual deve ser o seu novo nome?", cid)

elseif ret == RET_EXISTS then

selfSay(msg .. " já existe. Qual deve ser o seu novo nome?", cid)

end

end

elseif talk[cid] == 2 then

if msgcontains(msg, "yes") then

if (config.type == 'money' and doPlayerRemoveMoney(cid, config.money)) or (config.type ~= 'money' and doPlayerRemoveItem(cid, config.item[1], config.item[2])) then

local curName = getPlayerName(cid)

doRemoveCreature(cid)

db.executeQuery("UPDATE players SET name = '"..name[cid].."' WHERE name = '"..curName.."';")

else

selfSay("Você não tem " .. (config.type == "money" and (config.money .. " gold") or (config.item[2] .. ' ' .. (config.item[2] > 1 and getItemPluralNameById(config.item[1]) or getItemNameById(config.item[1])))) .. "!", cid)

talk[cid] = 0

end

else

selfSay("Não estou disponível no momento, talvez mais tarde.", cid)

talk[cid] = 0

end

end

return true

end

npcHandler:setMessage(MESSAGE_FAREWELL, "tchau.")

npcHandler:setMessage(MESSAGE_WALKAWAY, "Vá embora")

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, messageDefaultCallback)

npcHandler:setCallback(CALLBACK_FAREWELL, creatureFarewell)

npcHandler:setCallback(CALLBACK_CREATURE_DISAPPEAR, creatureFarewell)

npcHandler:setCallback(CALLBACK_GREET, creatureGreetCallback)

npcHandler:addModule(FocusModule:new())

 

Pronto o npc ja irá estar funcionando, lembrando que ele cobra 100 crystal coins para mudar o nome.

Caso queira colocar outro equipamento para cobrar.

 

SUBSTITUA:

item = {

2160, 100}, -- itemid, itemcount

POR:

item = {

9971, 100}, -- itemid, itemcount

 

Peço que antes de postar um tópico por favor o revise pois não existe em seu script a parte de  item = {2160, 100}, -- itemid, itemcount .

 

e o mesmo não esta funcionando na hora de trocar o nome do personagem. 

 

 

Até breve 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo