Tipo queria um npc que para o player viajar com ele presisaria de level 25 e ce o player for maior que level 30 ele não pode viajar alguem sabe ;D
ola alguem poderia me dar um npc que tem level minimo e maxim ode viajar ?

Sabe fazer o XML?
data/npc/scripts
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local cfg = { min_level = 25, --Level mínimo necessário para ser teleportado. max_level = 30, --Level máximo necessário para ser teleportado. to_go = {x = xxx, y = yyy, z = zzz}, --Para onde o player será teleportado. } if msgcontains(msg, 'viajar') or msgcontains(msg, 'viajem') then if getPlayerLevel(cid) >= cfg.min_level and getPlayerLevel(cid) <= cfg.max_level then --Levels que o player pode viajar: 25, 26, 27, 28, 29 e 30. selfSay("Boa viagem!", cid) doTeleportThing(cid, cfg.to_go) talkState[talkUser] = 0 return true else selfSay("Você precisa estar, no mínimo, level "..cfg.min_level.." e no máximo level "..cfg.max_level.." para viajar.", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
TY N CEI CE VAI PEGA MAIS REP
O cara teria como vc coloca ae assim quando o player viajasse trocaria a sidade natal dele ?
Aí ficaria assim:
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local cfg = { min_level = 25, --Level mínimo necessário para ser teleportado. max_level = 30, --Level máximo necessário para ser teleportado. to_go = {x = xxx, y = yyy, z = zzz}, --Para onde o player será teleportado. townid = 2, --ID da cidade que será natal do player. } if msgcontains(msg, 'viajar') or msgcontains(msg, 'viajem') then if getPlayerLevel(cid) >= cfg.min_level and getPlayerLevel(cid) <= cfg.max_level then --Levels que o player pode viajar: 25, 26, 27, 28, 29 e 30. selfSay("Boa viagem!", cid) doPlayerSetTown(cid, cfg.townid) doTeleportThing(cid, cfg.to_go) talkState[talkUser] = 0 return true else selfSay("Você precisa estar, no mínimo, level "..cfg.min_level.." e no máximo level "..cfg.max_level.." para viajar.", cid) talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Boa sorte.
Atenciosamente,
Adriano Swatt'
Valeu cara a onde eu do o rep mesmo ? rsrsrsrsrsrsrsrssrsrsrs
Você sabe onde posso faser um client proprio 9.83 ?
Tópico movido para a seção de dúvidas e pedidos resolvidos.
Bons tempos...
[Portfólio de scripts]
Valeu cara a onde eu do o rep mesmo ? rsrsrsrsrsrsrsrssrsrsrs
Você sabe onde posso faser um client proprio 9.83 ?
Era só clicar em Curtir.
Enfim, que bom que funcionou.
Sobre o Client próprio você precisa especificar melhor o que quer, creio que seja viável criar um tópico para este caso já não haja um que te ajude.
Atenciosamente,
Adriano Swatt'
a cara queria um client proprio versão 9.83 queria aprender faser um
Po cara voltei atrás aki nesse tópico pq o npc n ta mudando a cidade natal do player.
Lembrou de editar nesta parte do script para a ID da cidade que deseja que seja a nova cidade do player?
townid = 2, --ID da cidade que será natal do player.
Boa sorte.
Atenciosamente,
Adriano Swatt'