chaduka 1 Postado Março 11, 2014 Share Postado Março 11, 2014 Olá, alguem poderia me ajudar com um script para mandar mensagem para o player a cada 1 minuto, até ele atingir o level 50!? Link para o comentário https://xtibia.com/forum/topic/229880-mandar-msg-at%C3%A9-level-50/ Compartilhar em outros sites More sharing options...
0 DuuhCarvalho 327 Postado Março 11, 2014 Share Postado Março 11, 2014 (editado) explica mais por favor ... function onThink(cid, interval) if getPlayerLevel(cid) < 50 then if getPlayerStorageValue(cid, 10203040) - os.time() <= 0 then doPlayerSendTextMessage(cid, 22, "Mensagem aqui.") setPlayerStorageValue(cid, 10203040, os.time()+1*1*60) end end return true end login.lua : registerCreatureEvent(cid, "Nome do Evento") creaturescripts.xml : <event type="think" name="Nome do Evento" event="script" value="Nome do Arquivo.lua"/> não conseguir pensar em outra maneira já que a função onThink é executada a cada 500ms . Editado Março 11, 2014 por DuuhCarvalho Link para o comentário https://xtibia.com/forum/topic/229880-mandar-msg-at%C3%A9-level-50/#findComment-1621981 Compartilhar em outros sites More sharing options...
0 zipter98 1102 Postado Março 11, 2014 Share Postado Março 11, 2014 Ou: local message = "Mensagem que será enviada ao jogar de 1 em 1 minuto." local function sendMsg(cid) if not isCreature(cid) then return true end doPlayerSendTextMessage(cid, 27, message) addEvent(sendMsg, 1000 * 60, cid) end function onLogin(cid) if getPlayerLevel(cid) < 50 then sendMsg(cid) end return true end Link para o comentário https://xtibia.com/forum/topic/229880-mandar-msg-at%C3%A9-level-50/#findComment-1622053 Compartilhar em outros sites More sharing options...
0 chaduka 1 Postado Março 12, 2014 Autor Share Postado Março 12, 2014 O do Duuh funcionou, mas como faço para configurar o tempo? Link para o comentário https://xtibia.com/forum/topic/229880-mandar-msg-at%C3%A9-level-50/#findComment-1622315 Compartilhar em outros sites More sharing options...
0 DuuhCarvalho 327 Postado Março 12, 2014 Share Postado Março 12, 2014 é o mesmo script só deixei mais fácil pra configurar . function onThink(cid, interval) local time = 1 -- tempo em minutos if getPlayerLevel(cid) < 50 then if getPlayerStorageValue(cid, 10203040) - os.time() <= 0 then doPlayerSendTextMessage(cid, 22, "Mensagem aqui.") setPlayerStorageValue(cid, 10203040, os.time()+time*1*60) end end return true end Link para o comentário https://xtibia.com/forum/topic/229880-mandar-msg-at%C3%A9-level-50/#findComment-1622321 Compartilhar em outros sites More sharing options...
0 DuuhCarvalho 327 Postado Março 29, 2014 Share Postado Março 29, 2014 Tópico movido para Pedidos e dúvidas resolvidos. Link para o comentário https://xtibia.com/forum/topic/229880-mandar-msg-at%C3%A9-level-50/#findComment-1630471 Compartilhar em outros sites More sharing options...
Pergunta
chaduka 1
Olá, alguem poderia me ajudar com um script para mandar mensagem para o player a cada 1 minuto, até ele atingir o level 50!?
Link para o comentário
https://xtibia.com/forum/topic/229880-mandar-msg-at%C3%A9-level-50/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados