Postado Março 12, 2017 8 anos 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
Postado Março 12, 2017 8 anos 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
Postado Março 12, 2017 8 anos Autor Que rapido, obrigado! Não tenho mais rep por hoje, mas amanhã retribuo por esse script, acho muito justo.
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.