-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
script alguém pode me ajudar nessa spells aqui, queira que colocassem pro meu personagem ficar inatingível por 6 segundos e podendo atacar livremente
Por lazaroszz,
- 0 respostas
- 1027 visualizações
-
- 3 respostas
- 4289 visualizações
-
- 0 respostas
- 2109 visualizações
-
- 2 respostas
- 1928 visualizações
-
- 1 resposta
- 1638 visualizações
-

Pergunta
ewerton91 3
Primera mente Boa noite!! (ou bom dia)!! Se eu estiver no lugar errado me mova plx!!
Estou a 2h e meia tentando terminar este npc mas não consigo, eu peguei aqui no forum mas não consigo terminar.
Ele funciona da seguinte forma.
Ele oferece 2 items pra troca nucleo medio ou nucleo altissimo.
Se eu dizer nucleo medio ele me retira 500 do item e me da o nucleo.
Se eu dizer nucleo altissimo ele me retira 1000 do item e me da o nucleo.
Mas ele não me da o item, so retira. Ja tentei de todas as formas e não consegui.
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 playerHaveItems(cid, itemid) local items = type(itemid) == "table" and itemid or {itemid} for i = 1, #items do if getPlayerItemCount(cid, items[i]) <= 0 then return false end end return true end function doPlayerRemoveItems(cid, itemid, count) local items = type(itemid) == "table" and itemid or {itemid} for i = 1, #items do doPlayerRemoveItem(cid, items[i], count ~= nil and count or 1) end return nil end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, "nucleo medio") then if playerHaveItems(cid, {2157}) then doPlayerRemoveItems(cid, {2157}, 500) doPlayerAddItem(cid, 151, 1) else selfSay("Voce prescisa de 500 gold nuggets para ganhar um nucleo medio.") end end if msgcontains(msg, "nucleo altissimo") then if playerHaveItems(cid, {2157}) then doPlayerRemoveItems(cid, {2157}, 1000) doPlayerAddItem(cid, 152, 1) else selfSay("Voce prescisa de 1000 gold nuggets para ganhar um nucleo medio.") end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())Espero respostas =D.
Link para o comentário
https://xtibia.com/forum/topic/224012-pedido-me-ajude-a-terminar/Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados