Postado Abril 1, 2020 5 anos .Qual servidor ou website você utiliza como base? TFS 1.0 Qual o motivo deste tópico? Scripting de promover com level.. Citar Gostaria que alguém me ajudasse a colocar esse npc com level, tipo, ele promove o player com qualquer level... Você tem o código disponível? Se tiver publique-o aqui: 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, 'promover') or msgcontains(msg, 'promotion')) then selfSay('Eu posso promover você para {Medieval Spearman} custa 3 crystal coins, (30k). Você aceita? ', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerItemCount(cid, 2160) >= 3) then doPlayerRemoveItem(cid, 2160, 3) doPlayerSetVocation(cid,13) selfSay('Parabéns, agora você é um Medieval Spearman.', cid) else selfSay('Você não tem {crystal coins} Suficientes.', cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
Postado Abril 2, 2020 5 anos Solução @Jonathan005 utilize esse script ou usa como base para fazer o seu, grato. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 0, level = 7, promotion = 1, text = 'Congratulations! You are now promoted.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) npcHandler:addModule(FocusModule:new())
Postado Abril 2, 2020 5 anos Autor Valeu mesmo meu mano!! Só tenho uma dúvida.. local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 0, level = 35, promotion = 3, text = 'Congratulations! You are now promoted.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true}) esse local node ai, tem como eu usar 3 desses? no mesmo npc? uma promotion level 35, uma promotion level 101, e a outra level 200, dá um salve quando puder, valeu mano, é nois! Ficaria assim, porém, quando eu digo, promotion1, ele oferece a promotion, com o valor de 10k, e eu falo yes, ele promove.. porém, se eu falo promotion2, ele oferece a promotion 2, com o valor de 30k e tal, mas se eu falar yes, ele não promove, nem a promotion3.. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 local node1 = keywordHandler:addKeyword({'promotion1'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido custa 1 crystal coin (10k) ? . Voce aceita? ?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 10000, level = 35, promotion = 1, text = 'Congratulations! Você foi promovido.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto..', reset = true}) npcHandler:addModule(FocusModule:new()) local node2 = keywordHandler:addKeyword({'promotion2'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ser promovido custa 3 crystal coins (30k). Você aceita? ?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 30000, level = 101, promotion = 2, text = 'Congratulations! Você foi promovido.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto..', reset = true}) npcHandler:addModule(FocusModule:new()) local node3 = keywordHandler:addKeyword({'promotion3'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Você quer ser promovido custa 20 crystal coins (200k). Você aceita? ?'}) node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 200, promotion = 3, text = 'Congratulations! Você foi promovido.'}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Tudo bem, volte quando estiver pronto.', reset = true}) npcHandler:addModule(FocusModule:new())
Postado Abril 3, 2020 5 anos @Jonathan005 claro a variável node1 que está promovendo um jogador está sendo utilizada para todos, tem que mudar no lugar de node1 coloque node2 e node3, claro nas funções de váriavel, se der certo me fala.
Postado Abril 3, 2020 5 anos Autor Fala meu brother, deu certo sim, muito obrigado, eu tava colocando node1, 2 e 3, porém, só colocava no primeiro, esqueci de colocar nos outros, foi falta de atenção minha, perdão, valeu pela força, abraço meu mano!
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.