Postado Fevereiro 27, 2016 9 anos Eae, preciso de uma ajuda, tenho um script de uma quest que ganha a reward dando use no bau. Gostaria que alguém mudasse para ganhar a reward se o player passar por cima de tal tile. Eu tentei mudar, mas não consegui. Se alguém puder me ajudar, eu agradeço. local config = { storageQuest = 70001, timeWait = 1, -- tempo em dias. } function onUse(cid, item, frompos, item2, topos) if (getPlayerStorageValue(cid, config.storageQuest) < os.time()) then setPlayerStorageValue(cid, config.storageQuest, os.time() + (config.timeWait * 600)) doSendMagicEffect(getThingPos(cid), 73) doPlayerAddItem(cid,25860,1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabens! Voce acabou de completar a quest diaria.") else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Espere 20 horas pra poder pegar sua reward novamente.") end return true end
Postado Fevereiro 27, 2016 9 anos 32 minutos atrás, Ovini disse: Eae, preciso de uma ajuda, tenho um script de uma quest que ganha a reward dando use no bau. Gostaria que alguém mudasse para ganhar a reward se o player passar por cima de tal tile. Eu tentei mudar, mas não consegui. Se alguém puder me ajudar, eu agradeço. local config = { storageQuest = 70001, timeWait = 1, -- tempo em dias. } function onUse(cid, item, frompos, item2, topos) if (getPlayerStorageValue(cid, config.storageQuest) < os.time()) then setPlayerStorageValue(cid, config.storageQuest, os.time() + (config.timeWait * 600)) doSendMagicEffect(getThingPos(cid), 73) doPlayerAddItem(cid,25860,1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabens! Voce acabou de completar a quest diaria.") else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Espere 20 horas pra poder pegar sua reward novamente.") end return true end cara ta ae não testei mais é funcional: Spoiler function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) sto = 11112121212 horas = 20 -- em horas time = os.time() + horas*60*60 item = 25860 if getPlayerStorageValue(cid, sto) - os.time() < 1 then setPlayerStorageValue(cid, sto, time) doSendMagicEffect(getCreaturePosition(cid), 12) doPlayerAddItem(cid, item, 1) doPlayerSendTextMessage(cid, 22, "Parabens! Voce acabou de completar a quest diaria.") else doPlayerSendTextMessage(cid, 22, "Espere "..horas.." horas pra poder pegar sua reward novamente.") end return true end em movements copie um que tenha stepIN e acho que vc sabe o procedimento coloca o actionID e tals rsrs boa sorte espero ter ajudado qualquer erro chama Editado Fevereiro 27, 2016 9 anos por lenardo88 (veja o histórico de edições)
Postado Fevereiro 27, 2016 9 anos Solução Script: local config = { storageQuest = 70001, timeWait = 20, -- Tempo em horas. } function onStepIn(cid, item, position, fromPosition) if (getPlayerStorageValue(cid, config.storageQuest) < os.time()) then setPlayerStorageValue(cid, config.storageQuest, os.time() + (config.timeWait * 3600)) doSendMagicEffect(getThingPos(cid), 73) doPlayerAddItem(cid, 25860 ,1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabens! Voce acabou de completar a quest diaria.") doTeleportThing(cid, fromPosition) else doTeleportThing(cid, fromPosition) local s = getPlayerStorageValue(cid,config.storageQuest) - os.time() local h = math.ceil(((getPlayerStorageValue(cid, config.storageQuest)) - os.time()) / 3600) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Aguarde ".. s .." segundos (".. h .." horas) para pegar novamente.") end return true end TAG: <movevent type="StepIn" actionid="63301" event="script" value="nome_do_script.lua"/> ➥ Regras | Seções OTServ | Seções BOT
Postado Fevereiro 27, 2016 9 anos Autor Funcionou perfeitamente. Só tive que fazer uma mudança na TAG que ficou assim: <movevent event="StepIn" actionid="63301" script="questdiaria.lua"/> Talvez seja por causa do TFS. Muito Obrigado. REP+ Editado Fevereiro 27, 2016 9 anos por Ovini (veja o histórico de edições)
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.