Postado Julho 20, 2016 9 anos Olá pessoal, Estou criando um NPC que teleporte o player para o local {x,y,z} se o player tiver o level 200. Mas quando abro o server o erro é o seguinte: Segue os scripts <?xml version="1.0" encoding="UTF-8"?> <npc name="Halcrof, the Wizard" script="data/npc/scripts/halcrof.lua" access="5" lookdir="1"> <health now="1000" max="1000"/> <look type="130" head="38" body="39" legs="23" feet="50" addons="1"> <parameters> <parameter key="message_greet" value="Hello, |PLAYERNAME|! You do not seem too strong to {challenge} me."/> <parameter key="message_walkaway" value="Hey Hey, where you go?"/> <parameter key="message_farewell" value="Bye bye!"/> </parameters> </npc> # local tab = { level = 200, pos = {x = 1071, y = 1135, z = 10} } 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 if (msgcontains(msg, 'challenge')) then talkState[talkUser] = 1 selfSay('You are sure you want to go? You can not return.', cid) elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if (getPlayerLevel(cid) <= tab.level) then talkState[talkUser] = 0 doTeleportThing(cid, tab.pos) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) else talkState[talkUser] = 0 selfSay('I can only challenge players with level '..tab.level..' or less.', cid) end elseif (msgcontains(msg, 'no') and talkState[talkUser] == 1) then talkState[talkUser] = 0 selfSay('Come back when you are ready learner.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Agradeço desde já e já fica o convite se alguém souber mexer com scripts e actions e quiser me dar uma força pra abrir um OT, eu não quero tudo na mão, quero aprender a fazer scripts. Também estou com erro nas level doors do server. O padrão é que o RME só colocando a action id 1000+level as portas se configuram sozinhas. Mas no OT não tá dando certo, eu coloquei lá actionid 1100 porque queria que só level 100+ pudesse entrar e não foi, chequei se tinha outra action id com mesmo número e não. Editado Julho 20, 2016 9 anos por Felipe Lotz Outro Erro (veja o histórico de edições) Atenciosamente, Felipe Lotz.
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.