Ir para conteúdo
  • 0

So Premium account fala com npc


Kirsch

Pergunta

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)!

 

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") 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            end        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())
<?xml version="1.0" encoding="UTF-8"?><npc name="Blessed Tapion" script="bless.lua" walkinterval="2000" floorchange="0">    <health now="100" max="100"/>    <look type="557" head="20" body="39" legs="45" feet="7" addons="0"/>		<parameters><parameter key="message_greet" value="I am here to bless you, say {bless}." /><parameter key="message_farewell" value="Good bye, |PLAYERNAME|!" /><parameter key="message_idletimeout" value="Good bye, |PLAYERNAME|!" /></parameters></npc>

 

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

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 por rorix
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...