Postado Abril 8, 2022 3 anos Autor caso tiver alguém disponível além do vodkar, também ficaria agradecido
Postado Abril 12, 2022 3 anos local configInv = { ["20:29"] = { nombre = "TEST", posiciones = { from = { x = 130, y = 190, z = 7 }, to = { x = 137, y = 195, z = 7 } }, monstruos = { "1 Ventinho", "1 Dragon" } } } local noPvpDelay = 5 local monsterRewardId = 0 local function executeInvasion(config) doBroadcastMessage(config.nombre .. " inicio.") for index, info in pairs(config.monstruos) do local nombreMonstruo = info:match("%s(.+)") local monstruoCantidad = tonumber(info:match("(%d+)")) local x, y, z = math.random(config.posiciones.from.x, config.posiciones.to.x), math.random(config.posiciones.from.y, config.posiciones.to.y), math.random(config.posiciones.from.z, config.posiciones.to.z) local pos = {x = x, y = y, z = z} local summon = doSummonCreature(nombreMonstruo, pos) if monsterRewardId == 0 and (math.random(100) >= 50 or index == #config.monstruos) then monsterRewardId = summon end end end function onThink(interval, lastExecution) local invasion = configInv[tostring(os.date("%X")):sub(1, 5)] if invasion then setWorldType(WORLD_TYPE_NO_PVP) doBroadcastMessage(invasion.nombre) addEvent(executeInvasion, 1000 * 10 * 1, invasion) addEvent(setWorldType, 1000 * 60 * noPvpDelay, WORLD_TYPE_PVP) end return true end
Postado Abril 13, 2022 3 anos Autor Em 12/04/2022 em 23:22, So volto tarde disse: local configInv = { ["20:29"] = { nombre = "TEST", posiciones = { from = { x = 130, y = 190, z = 7 }, to = { x = 137, y = 195, z = 7 } }, monstruos = { "1 Ventinho", "1 Dragon" } } } local noPvpDelay = 5 local monsterRewardId = 0 local function executeInvasion(config) doBroadcastMessage(config.nombre .. " inicio.") for index, info in pairs(config.monstruos) do local nombreMonstruo = info:match("%s(.+)") local monstruoCantidad = tonumber(info:match("(%d+)")) local x, y, z = math.random(config.posiciones.from.x, config.posiciones.to.x), math.random(config.posiciones.from.y, config.posiciones.to.y), math.random(config.posiciones.from.z, config.posiciones.to.z) local pos = {x = x, y = y, z = z} local summon = doSummonCreature(nombreMonstruo, pos) if monsterRewardId == 0 and (math.random(100) >= 50 or index == #config.monstruos) then monsterRewardId = summon end end end function onThink(interval, lastExecution) local invasion = configInv[tostring(os.date("%X")):sub(1, 5)] if invasion then setWorldType(WORLD_TYPE_NO_PVP) doBroadcastMessage(invasion.nombre) addEvent(executeInvasion, 1000 * 10 * 1, invasion) addEvent(setWorldType, 1000 * 60 * noPvpDelay, WORLD_TYPE_PVP) end return true end Vlw Maninnn, está funcionando agora, porem ele só está summonando um mob independe da quantidade que eu ponha
Postado Abril 25, 2022 3 anos de uns tempos pra cá minha vida ta mais corrida que o normal, peço perdão por não ter dado um parecer local configInv = { ["20:29"] = { nombre = "TEST", posiciones = { from = { x = 130, y = 190, z = 7 }, to = { x = 137, y = 195, z = 7 } }, monstruos = { ["Ventinho"] = 1, ["Dragon"] = 1, } } } local noPvpDelay = 5 local function executeInvasion(config) doBroadcastMessage(config.nombre .. " inicio.") for index, info in pairs(config.monstruos) do local monsterName = index local quantity = info local x, y, z = math.random(config.posiciones.from.x, config.posiciones.to.x), math.random(config.posiciones.from.y, config.posiciones.to.y), math.random(config.posiciones.from.z, config.posiciones.to.z) local pos = {x = x, y = y, z = z} for i = 0, quantity do doSummonCreature(monsterName, pos) end end end function onThink(interval, lastExecution) local invasion = configInv[tostring(os.date("%X")):sub(1, 5)] if invasion then setWorldType(WORLD_TYPE_NO_PVP) doBroadcastMessage(invasion.nombre) addEvent(executeInvasion, 1000 * 10 * 1, invasion) addEvent(setWorldType, 1000 * 60 * noPvpDelay, WORLD_TYPE_PVP) end return true end
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.