Ir para conteúdo

Featured Replies

Postado

o ot tem 2 promotion a primeira é para quem não é vip por exemplo um elite knight vira member knight, e a segunda é só pra quem é vip, então eu estava querendo um script de npc.lua para estas funções :

vender promotion só se tiver a 1ª promotion

vender só se tiver level

vender só se tiver money para comprar

falas :

player : hi

npc: Welcome, Usuario! I have been expecting you!

player : promotion / vip promotion

npc :

You want to be promoted vip for 80000000 gold coins?

ou

You are already promoted, good bye... (npc sai da conversa)

player : yes

npc :

you don't have 80000000 gold coins to be promoted vip, good bye... (npc sai da conversa)

ou

Sorry, you need to have the first promotion to be promoted vip, good bye... (npc sai da conversa)

ou

Congratulations! You were promoted vip! good bye! (npc sai da conversa)

+++REP pra quem ajudar ai galera ! valeu :D !

Editado por serj100 (veja o histórico de edições)

  • Respostas 8
  • Visualizações 2.7k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Entedi, não é tão dificil basta adicionar um tempo a promotion , igual isso.. local storage = xxxxx setPlayerStorageValue(cid,storage,os.time()) Depois a verificação time = 30 * 24

Postado

Assim?


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 price = 80000000

if(msgcontains(msg, 'promotion') or msgcontains(msg, 'member promotion')) then

selfSay('Você quer ser promovido member por '..price..' moedas? {yes} ', cid)

talkState[talkUser] = 1

elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then

if doPlayerRemoveMoney(cid,price) then

if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 4 then

doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)

selfSay('Parabens! Você foi promovido member! ', cid)

talkState[talkUser] = 0

else

selfSay('Desculpe, você precisa ter a primeira promotion para ser promovido member.', cid)

talkState[talkUser] = 0

end

else

selfSay('Você não tem ' .. price .. ' moedas para ser promovido member...', cid)

talkState[talkUser] = 0

end

elseif msg == "no" and talkState[talkUser] >= 1 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())

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