Postado Abril 18, 2020 5 anos .Qual servidor ou website você utiliza como base? Qual o motivo deste tópico? Está surgindo algum erro? Se sim coloque-o aqui. Citar Ela não faz nada só fica falando e nao da a recompensa TFS 0.2 Você tem o código disponível? Se tiver publique-o aqui: 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 msg = string.lower(msg) tabble = { [50] = {item = {2173,1}, storage = 201320}, [100] = {item = {2160,5}, storage = 201321}, [150] = {item = {2123,1}, storage = 201322}, [200] = {item = {2466,1}, storage = 201320} } if isInArray({"recompensa","reward", "receber", "level"}, msg) then npcHandler:say("Olá guerreiro, eu posso entregar recompensas para o level {50}, {100}, {150} e {200}! qual dos leveis você deseja receber a recompensa?", cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if tabble[getNumber(msg)] then if getPlayerStorageValue(cid, tabble[getNumber(msg)].storage) <= 0 then if getPlayerLevel(cid) >= getNumber(msg) then doPlayerAddItem(cid,tabble[getNumber(msg)].item[1],tabble[getNumber(msg)].item[2]) setPlayerStorageValue(cid, tabble[getNumber(msg)].storage, 1) npcHandler:say("Parabéns! Você recebeu "..tabble[getNumber(msg)].item[2].." "..getItemNameById(tabble[getNumber(msg)].item[1]), cid) else npcHandler:say("Desculpe, mas você não tem level para receber essa recompensa!", cid) end else npcHandler:say("Desculpe, mas você já recebeu a sua recompensa!", cid) end else npcHandler:say("Desculpe, mas não tenho recompensa para esse level!", cid) end elseif isInArray({"no","nao"}, msg) then selfSay("Then not.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) function getNumber(txt) x = string.gsub(txt,"%a","") x = tonumber(x) if x ~= nill and x > 0 then return x else return 0 end end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
Postado Abril 18, 2020 5 anos Eu testei e aqui funcionou perfeitamente, mude as storages que estão dando ao player e não deixe elas iguais, no seu script a recompensa do level 50 está com a mesma storage do level 200 fazendo assim, quando o player level 200 for receber sua recompensa ele não irá ganhar! As storage estão aqui: storage = 201322 É só mudar o valor delas para uma na qual você não está utilizando!
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.