Postado Junho 9, 2018 7 anos Então, posta a solução, mano ! Outras pessoas podem ter essa mesma dúvida ou necessidade... O erro de vocês é esse: Vem atrás de resultados, quando encontra, não compartilha !
Postado Junho 9, 2018 7 anos Autor @FlavioHulk Utilizei outro código, não postei por questão de tempo mesmo mas segue ai: ESSE SCRIPT FUNCIONA DA SEGUINTE FORMA: APÓS VOCÊ USAR O ITEM ELE SERÁ REMOVIDO, PORÉM O PERSONAGEM QUE VOCÊ UTILIZAR NÃO IRÁ NECESSITAR NUNCA MAIS DE BLESS. TORNANDO AUTOMÁTICO. VÁ ATÉ: ACTION/SCRIPTS CRIE UM ARQUIVO .LUA Abra o arquivo e cole o seguinte código: local efeito = {27,28, 29,79} function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 89210) == 1 then doPlayerSendTextMessage(cid,22,"You already used this book!") else doPlayerSendTextMessage(cid,22,"Congratulations! From now, you will be blessed automatically.") setPlayerStorageValue(cid, 89210, 1) doRemoveItem(item.uid, 1) doSendMagicEffect(getThingPos(cid), efeito[math.random(#efeito)]) end end Logo após ter feito isso vá até actions.xml E adicione a Tag: <action itemid="IDDOITEMDESEJADO" event="script" value="actionbless.lua"/> Feito isso vá até CREATURESCRIPTS/SCRIPTS CRIE UM ARQUIVO .LUA E adicione o seguinte código: local cfg = { message = "You have been blessed automatically!", bless = {1, 2, 3, 4, 5}, efeito = {27,28, 29,79} } function onLogin(cid) for i = 1, #cfg.bless do if getPlayerStorageValue(cid, 89210) == 1 and getPlayerBlessing(cid, i) then doPlayerSendTextMessage(cid,22, "You are blessed!") return true end if getPlayerStorageValue(cid, 89210) == 1 then doPlayerAddBlessing(cid, i) doPlayerSendTextMessage(cid,22,cfg.message) doSendMagicEffect(getThingPos(cid), cfg.efeito[math.random(#cfg.efeito)]) end end return true end Logo após ter feito isso vá até creaturescripts.xml E adicione a Tag: <event type="login" name="blesscheck" event="script" value="blesscheck.lua"/> Em seguida vá até login.lua ainda em CREATURESCRIPTS/SCRIPTS/LOGIN.LUA e registre o seguinte evento: registerCreatureEvent(cid, "checkbless") O CRIADOR DO SCRIPT NÃO FUI EU, APENAS PEGUEI EM ALGUM SITE QUE PERDI SUA FONTE, ESPERO TER AJUDADO ALGUÉM E OBRIGADO QUEM AJUDOU.
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.