Ir para conteúdo

Featured Replies

Postado

alguém poderia colocar que so players Premium possam comprar a bless nesse npc 

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) 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
    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 true
end

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

ex: You not have {premium account}!

Postado
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) 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
    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 getPlayerPremiumDays(cid) > 0 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
                else
                    selfSay("You do not have premmium account.", 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 true
end

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

 

  • 2 weeks later...
Postado
  • Autor

chequei o script porem os players Premium quando vão comprar a bless, falam que eles precisão ser Premium ele logo manda essa mensagem  selfSay("You do not have premmium account.", cid) tinha que dizer só para quem não é premium 

 

 

alguém pode me ajudar ?

 

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) 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
    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
            end
else
selfSay("You not have {Premium account}!", cid)
        end
    end

    if msgcontains(msg:lower(), "no") and talkState[talkUser] >= 1 then
        selfSay("Bye!!", cid)
        talkState[talkUser] = 0
    end
    return true
end

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

 

alguem ajuda ?

Postado
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) 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 premium = true
	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 premium and isPremium(cid) 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
				else
					selfSay("You need premium account.", 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 true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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