Postado Fevereiro 8, 2021 4 anos tem uma quest no meu servidor que puxa alavanca e nasce uns bosses porem ela só da pra fazer em 4 jogadores queria que desse pra fazer tando com os 4 quanto se so 1 quiser fazer tambem Citar local config = { requiredLevel = 100, daily = false, centerDemonRoomPosition = Position(30819, 32036, 7), playerPositions = { Position(30800, 32056, 7), Position(30799, 32056, 7), Position(30798, 32056, 7), Position(30797, 32056, 7) }, newPositions = { Position(30820, 32036, 7), Position(30819, 32036, 7), Position(30818, 32036, 7), Position(30817, 32036, 7) }, demonPositions = { Position(30815, 32034, 7), Position(30817, 32034, 7), Position(30819, 32034, 7), Position(30815, 32038, 7), Position(30817, 32038, 7), Position(30821, 32036, 7), Position(30822, 32036, 7), Position(30819, 32038, 7) } } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1946 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions[i]):getTopCreature() if not playerTile or not playerTile:isPlayer() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 4 players.") return true end if playerTile:getLevel() < config.requiredLevel then player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end storePlayers[#storePlayers + 1] = playerTile end local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 3, 3, 2, 2) for i = 1, #specs do spec = specs[i] if spec:isPlayer() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the quest room.") return true end spec:remove() end for i = 1, #config.demonPositions do Game.createMonster("Infernal Boss", config.demonPositions[i]) end local players for i = 1, #storePlayers do players = storePlayers[i] config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF) players:teleportTo(config.newPositions[i]) config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA) players:setDirection(DIRECTION_EAST) end elseif item.itemid == 1945 then if config.daily then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) return true end end item:transform(item.itemid == 1946 and 1945 or 1946) return true end
Postado Fevereiro 13, 2021 4 anos Solução Testa aí: Spoiler local config = { requiredLevel = 100, daily = false, centerDemonRoomPosition = Position(30819, 32036, 7), playerPositions = { Position(30800, 32056, 7), Position(30799, 32056, 7), Position(30798, 32056, 7), Position(30797, 32056, 7) }, newPositions = { Position(30820, 32036, 7), Position(30819, 32036, 7), Position(30818, 32036, 7), Position(30817, 32036, 7) }, demonPositions = { Position(30815, 32034, 7), Position(30817, 32034, 7), Position(30819, 32034, 7), Position(30815, 32038, 7), Position(30817, 32038, 7), Position(30821, 32036, 7), Position(30822, 32036, 7), Position(30819, 32038, 7) } } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1946 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions[i]):getTopCreature() if playerTile and playerTile:isPlayer() then if playerTile:getLevel() >= config.requiredLevel then storePlayers[#storePlayers + 1] = playerTile else player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end end end if #storePlayers < 1 then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need at least 1 player.") return true end local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 3, 3, 2, 2) for i = 1, #specs do spec = specs[i] if spec:isPlayer() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the quest room.") return true end spec:remove() end for i = 1, #config.demonPositions do Game.createMonster("Infernal Boss", config.demonPositions[i]) end local players for i = 1, #storePlayers do players = storePlayers[i] config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF) players:teleportTo(config.newPositions[i]) config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA) players:setDirection(DIRECTION_EAST) end elseif item.itemid == 1945 then if config.daily then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) return true end end item:transform(item.itemid == 1946 and 1945 or 1946) return true end
Postado Fevereiro 14, 2021 4 anos Autor Em 13/02/2021 em 14:41, 139 disse: Testa aí: Ocultar conteúdo local config = { requiredLevel = 100, daily = false, centerDemonRoomPosition = Position(30819, 32036, 7), playerPositions = { Position(30800, 32056, 7), Position(30799, 32056, 7), Position(30798, 32056, 7), Position(30797, 32056, 7) }, newPositions = { Position(30820, 32036, 7), Position(30819, 32036, 7), Position(30818, 32036, 7), Position(30817, 32036, 7) }, demonPositions = { Position(30815, 32034, 7), Position(30817, 32034, 7), Position(30819, 32034, 7), Position(30815, 32038, 7), Position(30817, 32038, 7), Position(30821, 32036, 7), Position(30822, 32036, 7), Position(30819, 32038, 7) } } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1946 then local storePlayers, playerTile = {} for i = 1, #config.playerPositions do playerTile = Tile(config.playerPositions[i]):getTopCreature() if playerTile and playerTile:isPlayer() then if playerTile:getLevel() >= config.requiredLevel then storePlayers[#storePlayers + 1] = playerTile else player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.") return true end end end if #storePlayers < 1 then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need at least 1 player.") return true end local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 3, 3, 2, 2) for i = 1, #specs do spec = specs[i] if spec:isPlayer() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the quest room.") return true end spec:remove() end for i = 1, #config.demonPositions do Game.createMonster("Infernal Boss", config.demonPositions[i]) end local players for i = 1, #storePlayers do players = storePlayers[i] config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF) players:teleportTo(config.newPositions[i]) config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA) players:setDirection(DIRECTION_EAST) end elseif item.itemid == 1945 then if config.daily then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) return true end end item:transform(item.itemid == 1946 and 1945 or 1946) return true end deu certo obrigado !
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.