Ir para conteúdo

Featured Replies

Postado
4 horas atrás, JoviM disse:

@hiquezerah Qualquer erro ou dúvida só marcar.

  Ocultar conteúdo


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 buff_str = 211100 -- Storage da missao dos buffs
local buff = {

	health = 100, -- Vida
	mana = 100, -- Mana
	req_lvl = 10, -- Level necessário
	req_item = 2160, -- Item necessário
	storage = 23123123 -- Storage do buff
}

if (msgcontains(msg, "buff")) then
	if getPlayerStorageValue(cid, buff_str) >= 1 then
		if getPlayerStorageValue(cid, buff.storage) <= 0 then
			if getPlayerItemCount(cid, buff.req_item) >= 1 then
				if getPlayerLevel(cid) >= buff.req_lvl then
					setCreatureMaxHealth(cid, buffbuff.health)
					setCreatureMaxMana(cid, buffbuff.mana)
					doPlayerRemoveItem(cid, buffbuff.req_item, 1)
					setPlayerStorageValue(cid, buffbuff.storage, 1)
					selfSay("Voce recebeu o buff um.", cid)
				else
					selfSay("Voce precisa de no minimo level "..buff.req_lvl..".", cid)
				end
			else
				selfSay("Voce nao possui 1 "..getItemNameById(buff.req_item)..".", cid)
			end
		else
			selfSay("Voce ja adquiriu este buff uma vez.", cid)
		end
	else
		selfSay("Voce precisa completar a missao dos buffs.", cid)
	end
	return true
end

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

 

 

 

está dando esse erro na distro mano e muito obrigado por estar ajudando.

Screenshot_1.png

  • Respostas 16
  • Visualizações 1.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • nego não aprende.

  • cara eu fiz um item storage = 211100 -- storage checada local level = 100 -- level desejado local item = 2545 -- item 1 function onUse(cid, item) -- função e parametros if getPlayerLevel(cid) &l

  • @Maniaco Me desculpe se esqueci de alguma verificação hahaha.   Npc.lua   Npc.xml  

Posted Images

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.6k

Informação Importante

Confirmação de Termo