Postado Novembro 15, 2017 7 anos Gostaria de saber se é possível colocar contagem regressiva no tp após monstro morrer e ter gerado o tp Script do tp após o monstro morrer Spoiler local tpId = 1387 local tps = { ["Monstro"] = {pos = {x=X, y=X, z=X}, toPos = {x=X, y=X, z=X}, time = 30}, } function removeTp(tp) local t = getTileItemById(tp.pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos, CONST_ME_POFF) end end function onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.time*1000, tp) end return TRUE end
Postado Novembro 15, 2017 7 anos 9 minutos atrás, War disse: Gostaria de saber se é possível colocar contagem regressiva no tp após monstro morrer e ter gerado o tp Script do tp após o monstro morrer Ocultar conteúdo local tpId = 1387 local tps = { ["Monstro"] = {pos = {x=X, y=X, z=X}, toPos = {x=X, y=X, z=X}, time = 30}, } function removeTp(tp) local t = getTileItemById(tp.pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos, CONST_ME_POFF) end end function onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.time*1000, tp) end return TRUE end Tenta assim Spoiler local tpId = 1387 local tps = { ["Monstro"] = {pos = {x=X, y=X, z=X}, toPos = {x=X, y=X, z=X}, time = 30}, } function removeTp(tp) local t = getTileItemById(tp.pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos, CONST_ME_POFF) end end function onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.time*1000, tp) end end function countPos(pos,tempo) if tempo > 0 then doSendAnimatedText(pos,tempo,TEXTCOLOR_RED) addEvent(countPos,1000,pos,tempo-1) else doSendMagicEffect(pos,2) end return TRUE end
Postado Novembro 15, 2017 7 anos Eu ajustei a função do @Zzyzx, ele criou a função pra contar o tempo mas não chamou ela, só isso. Spoiler local tpId = 1387 local tps = { ["Monstro"] = {pos = {x=X, y=X, z=X}, toPos = {x=X, y=X, z=X}, time = 30}, } function countPos(pos, tempo) if tempo > 0 then doSendAnimatedText(pos,tempo,TEXTCOLOR_RED) addEvent(countPos, 1000, pos, tempo-1) else local t = getTileItemById(pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(pos, CONST_ME_POFF) end end return true end function onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) countPos(tp.pos, tp.time) end end OBS: Não cheguei a testar.
Postado Novembro 15, 2017 7 anos 4 horas atrás, Noninhouh disse: Eu ajustei a função do @Zzyzx, ele criou a função pra contar o tempo mas não chamou ela, só isso. Mostrar conteúdo oculto local tpId = 1387 local tps = { ["Monstro"] = {pos = {x=X, y=X, z=X}, toPos = {x=X, y=X, z=X}, time = 30}, } function countPos(pos, tempo) if tempo > 0 then doSendAnimatedText(pos,tempo,TEXTCOLOR_RED) addEvent(countPos, 1000, pos, tempo-1) else local t = getTileItemById(pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(pos, CONST_ME_POFF) end end return true end function onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) countPos(tp.pos, tp.time) end end OBS: Não cheguei a testar. @Noninhouh pode pa, nao manjo nada de scripts kkkkk, só tentei fazer uma gambiarra com essa função que tinha na minha mw kkkkkkkk xd
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.