Ir para conteúdo

Featured Replies

Postado

@Darwiinxp 

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 price = 60000    -------- precio

    if msgcontains(msg, 'bless') then     ----------------Z lo que hay que decirle
        if isPremium(cid) == TRUE then
            if getPlayerMoney(cid) <= price then
                selfSay('I will give to you all blessings, but you will have to make a sacrifice. Are you prepared to pay '.. price ..' gold for the blessings?', cid)
                talkState[talkUser] = 1
            else
                selfSay('Oh. You do not have enough money.', cid)
                talkState[talkUser] = 0
            end
        else
            selfSay('Oh. Only premium players can buy blessings.', cid)
            talkState[talkUser] = 0
        end

    elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
            selfSay('Sorry, but you already have one of the blessing.', cid)
            talkState[talkUser] = 0
        else
            if doPlayerRemoveMoney(cid, price) == TRUE then
        doPlayerAddBlessing(cid, 1)
        doPlayerAddBlessing(cid, 2)
        doPlayerAddBlessing(cid, 3)
        doPlayerAddBlessing(cid, 4)
        doPlayerAddBlessing(cid, 5)
                selfSay('Now the Gods blessed you.', cid)
            else
                selfSay('Oh. You do not have enough money.', cid)
            end
        end
        
    elseif msgcontains(msg, 'no') and (talkState[talkUser] == 1) then
        selfSay('Ok, Good Bye Adventurer.', cid)
        talkState[talkUser] = 0
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

  • Respostas 8
  • Visualizações 978
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @Darwiinxp  local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreature

  • @Darwiinxp Amigo, as lib dos seus npcs devem estar erradas, podem não conter as funções necessárias, acabei de testar no meu server e funcionou normalmente.

Postado
  • Autor
Eu faço o diálogo normal, mas quando digo "yes" para confirmar,
 o npc não responde mais a mim.
21:30 Bless William: Welcome, Raynexz! I have been expecting you.
21:30 Raynexz [504]: bless
21:30 Bless William: Excelente! si aun estas interesado confirmame la compra con yes para concluir .
21:30 Raynexz [504]: yes
e isso continua aparecendo no console
[Warning - Bless William] NpcSystem:
Parameter 'keyword_reply2' missing. Skipping...

 

Postado
  • Autor

 

existe alguma maneira de corrigir isso? Postando sua libs? uso TFS 0.4

12 minutos atrás, Baalszor disse:

@Darwiinxp Amigo, as lib dos seus npcs devem estar erradas, podem não conter as funções necessárias, acabei de testar no meu server e funcionou normalmente.

 

Amigo já resolvi isso, foi um erro nas palavras-chave! Tive que remover algumas linhas do meu arquivo .xml

 

foi assim que resolvi
 

<?xml version="1.0" encoding="UTF-8"?>
	<npc name="Bless William" script="BlessMan.lua" walkinterval="2000" floorchange="0" speechbubble="1">
	<health now="100" max="100"/>
	<look type="134" head="58" body="114" legs="87" addons="3"/>
	<parameters>
		<parameter key="keywords" value="bless;blessings" />

	</parameters>
</npc>

 

 

55 minutos atrás, Baalszor disse:

@Darwiinxp Amigo, as lib dos seus npcs devem estar erradas, podem não conter as funções necessárias, acabei de testar no meu server e funcionou normalmente.

com o god o script funciona bem,
 mas com os jogadores não, mesmo que tenha dinheiro, o npc diz o seguinte:

22:31 Qwerty [75]: hi
22:31 Bless William: Welcome, Qwerty! I have been expecting you.
22:32 Qwerty [75]: bless
22:32 Bless William: Oh. You do not have enough money.

 

E que tenho dinheiro suficiente, como faço para resolver isso?

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