Oi tudo bem!
Gostaria se possível de um NPC que verifique se o player tem essas storage e se sim, remover elas:
storagesDuel = {52480, 52481, 52482, 52482, 52483, 52484, 52485, 6598754}
Oi tudo bem!
Gostaria se possível de um NPC que verifique se o player tem essas storage e se sim, remover elas:
storagesDuel = {52480, 52481, 52482, 52482, 52483, 52484, 52485, 6598754}
Sabe fazer o .xml?
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 storagesDuel = {52480, 52481, 52482, 52482, 52483, 52484, 52485, 6598754} local t = {} if msgcontains(msg:lower(), "storage") or msgcontains(msg:lower(), "remove") then for storage = 1, #storagesDuel do if getPlayerStorageValue(cid, storagesDuel[storage]) > -1 then table.insert(t, storagesDuel[storage]) end end if #t < 1 then selfSay("O valor de todas as storages de Duel no seu personagem é -1.", cid) talkState[talkUser] = 0 return true else selfSay("Storages removidas.", cid) for i = 1, #t do setPlayerStorageValue(cid, t[i], -1) end talkState[talkUser] = 0 return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
aa brigadao era isso mesmo! parabéns pelo trabalho!!
Tópico movido para a seção de dúvidas e pedidos resolvidos.
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.