Ir para conteúdo

Featured Replies

Postado

Só acrescentar 1 mensagem no script, e uma função que roube 80k do player ao clicar no item.

 

"Você não tem 80k para usar o item, portanto ficara sem bless".

 

 

local cfg = {
bless = { 1, 2, 3, 4, 5 },
level = 8
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 1, table.maxn(cfg.bless) do
     if(getPlayerBlessing(cid, cfg.bless[i])) then
         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
         doCreatureSay(cid, "You have already been blessed.", TALKTYPE_ORANGE_1)
         return true
     end
end
if getPlayerLevel(cid) >= cfg.level then
     for i = 1, table.maxn(cfg.bless) do
         doPlayerAddBlessing(cid, cfg.bless[i])
     end
     doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
     doSendAnimatedText(getCreaturePosition(cid), "BLESSED!", TEXTCOLOR_RED)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been blessed by the gods.")
end
return true
end

 

Resolvido por psychonaut

Ir para solução
Postado
  • Solução
Spoiler

local cfg = {
bless = { 1, 2, 3, 4, 5 },
level = 8
}

function onUse(cid, item, fromPosition, itemEx, toPosition)


for i = 1, table.maxn(cfg.bless) do
     if(getPlayerBlessing(cid, cfg.bless[i])) then
         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
         doCreatureSay(cid, "You have already been blessed.", TALKTYPE_ORANGE_1)
         return true
     end
end
if getPlayerLevel(cid) >= cfg.level then
	if doPlayerRemoveMoney(cid, 80000) == TRUE then
     for i = 1, table.maxn(cfg.bless) do
         doPlayerAddBlessing(cid, cfg.bless[i])
     end
     doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
     doSendAnimatedText(getCreaturePosition(cid), "BLESSED!", TEXTCOLOR_RED)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been blessed by the gods.")
	 
	 else
	 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce nao tem 80k para usar o item, portanto ficara sem bless")
	 end
	 
end
return true
end

 

 

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