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







info
Grupo: Campones
Registrado: 11/04/13
Posts: 70
Reputação: +2
Char no Tibia: jhony max
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