Ir para conteúdo

Featured Replies

Postado
  • Autor

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

    if msgcontains(msg, 'present') and getPlayerVocation(cid) == 1 and

getPlayerStorageValue(cid, 3058) < 1 then

	    setPlayerStorageValue(cid, 21718, 1)

    doPlayerAddItem(cid,2160,1)

    selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 2 and

getPlayerStorageValue(cid, 3058) < 1 then

	    setPlayerStorageValue(cid, 21718, 1)

    doPlayerAddItem(cid,2160,1)

    selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 3 and

getPlayerStorageValue(cid, 3058) < 1 then

	    setPlayerStorageValue(cid, 21718, 1)

    doPlayerAddItem(cid,2160,1)

    selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 4 and

getPlayerStorageValue(cid, 3058) < 1 then

	    setPlayerStorageValue(cid, 21718, 1)

    doPlayerAddItem(cid,2160,1)

    selfSay("Pegue este item.", cid)

    end

    end

end

end

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

  • Respostas 15
  • Visualizações 1.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado

Copia esse e cola no seu npc/script e tenta


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

	    if msgcontains(msg, 'present') and getPlayerVocation(cid) == 1 or


getPlayerVocation(cid) == 2 and getPlayerStorageValue(cid, 21718) < 1 then

        setPlayerStorageValue(cid, 21718, 1)

			    doPlayerAddItem(cid,2160,1)

			    selfSay("Pegue este item.", cid)


if msgcontains(msg, 'present') and getPlayerVocation(cid) == 2 and


getPlayerStorageValue(cid, 21718) < 1 then

        setPlayerStorageValue(cid, 21718, 1)

			    doPlayerAddItem(cid,2160,1)

			    selfSay("Pegue este item.", cid)


if msgcontains(msg, 'present') and getPlayerVocation(cid) == 3 and


getPlayerStorageValue(cid, 21718) < 1 then

        setPlayerStorageValue(cid, 21718, 1)

			    doPlayerAddItem(cid,2160,1)

			    selfSay("Pegue este item.", cid)


if msgcontains(msg, 'present') and getPlayerVocation(cid) == 4 and


getPlayerStorageValue(cid, 21718) < 1 then

        setPlayerStorageValue(cid, 21718, 1)

			    doPlayerAddItem(cid,2160,1)

			    selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 5 and


getPlayerStorageValue(cid, 21718) < 1 then

        setPlayerStorageValue(cid, 21718, 1)

			    doPlayerAddItem(cid,2160,1)

			    selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 6 and getPlayerStorageValue(cid, 21718) < 1 then

        setPlayerStorageValue(cid, 21718, 1)

			    doPlayerAddItem(cid,2160,1)

			    selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 7 and getPlayerStorageValue(cid, 21718) < 1 then

        setPlayerStorageValue(cid, 21718, 1)

			    doPlayerAddItem(cid,2160,1)

			    selfSay("Pegue este item.", cid)

if msgcontains(msg, 'present') and getPlayerVocation(cid) == 8 and getPlayerStorageValue(cid, 21718) < 1 then

        setPlayerStorageValue(cid, 21718, 1)

			    doPlayerAddItem(cid,2160,1)

			    selfSay("Pegue este item.", cid)

	    end

	    end

	    end

	    end

	    end

	    end

end

end

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)


npcHandler:addModule(FocusModule:new())

Postado
  • Autor

É o mesmo script seu, só alterei o item, 3048 (Um ring), quando fala "present" pro npc ele não entrega o ring, e não da nenhum erro.

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

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