@up ninguem ajuda mais mesmo!!!
- Fórum
- OTServ
- Suporte
- Resolvidos
- So Premium account fala com npc
4
1.5k
05 de fevereiro de 2017 às 22:12
05 de fevereiro de 2017 às 23:15
Melhor resposta
tente
local config = { -- [bless] = preços [5] = {"Blessing", 500000}}local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid for k, v in pairs(config) do if v[1]:lower():find(msg:lower()) then selfSay("You are sure?", cid) talkState[talkUser] = k end if msgcontains(msg:lower(), "yes") and isPremium(cid) then if talkState[talkUser] == k then if not getPlayerBlessing(cid, k) then if doPlayerRemoveMoney(cid, v[2]) then doPlayerAddBlessing(cid, k) selfSay("You received the bless " .. v[1]:gsub("The ", "", 1) .. "!", cid) doSendMagicEffect(getThingPos(cid), 10) else selfSay("You no have money.", cid) end else selfSay("You have " .. v[1] .. ".", cid) end talkState[talkUser] = 0 endelseselfSay("You need a vip account.", cid) end end if msgcontains(msg:lower(), "no") and talkState[talkUser] >= 1 then selfSay("Bye!!", cid) talkState[talkUser] = 0 end return trueendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())
57 minutos atrás, Kirsch disse:@up ninguem ajuda mais mesmo!!!
Editado Fevereiro 5 por rorix




info
Grupo: Campones
Registrado: 06/10/15
Posts: 54
Reputação: +18
alguem poderia coloca nesse script de npc que vende bless para vender todas as bless como uma so tipo all bless, e colocar para so player premium comprar bless
com uma msg ex: You not have(Premium account)!
Editado Fevereiro 10 por Frenvius