.Qual servidTor ou website você utiliza como base? TFS 1.2
Qual o motivo deste tópico?
Pessoa, estou criando um otserver 8.0 TFS 1.2 e estou fazendo sistema de boss diário igual ao global, então resolvi cria um boss próprio para testar.
A principio está tudo ok, só que eu queria por TEMPO para que pudesse ser feito essa action por exemplo, a cada 16 horas, os jogadores podem fazer denovo. Está configurado no estilo anihi, então se puderem ajudar agradeço. Vou deixar o código e uma print anexado, obrigado!
Está surgindo algum erro? Se sim coloque-o aqui.
Você tem o código disponível? Se tiver publique-o aqui:
local config = {
time = 1,
requiredLevel = 80, -- Level que pode usa o item ou a lavanca
daily = false, -- nao mexe nisso
centerDemonRoomPosition = Position(32836, 31915, 7), -- position que o player vai cai dentro da sala do boss
playerPositions = {
Position(32838, 31917, 6), -- position de onde os player pode usa o Item ou lavanca
Position(32837, 31917, 6),
Position(32836, 31917, 6),
Position(32835, 31917,6)
},
newPositions = {
Position(32836, 31915, 7), -- Mesma position onde os player vai cai dentro da sala se for varios player em varios lugares é so coloca em cada uma position.
Position(32836, 31916, 7),
Position(32836, 31917, 7),
Position(32836, 31918, 7)
},
soltoPosition = {
Position(159, 51, 7) -- position onde o player vai quando acaba o tempo dele.
},
demonPositions = {
Position(32833, 31915, 7) -- position do boss se quizer por mais de um boss é so adiciona Position(33219, 31657, 13), com a virgula
}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 1945 then -- item que é usado para entra na area do boss
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, "Voce nao esta no lugar certo.")
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, 100, 100, 100, 100)
for i = 1, #specs do
spec = specs[i]
if spec:isPlayer() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "Tem alguem lutando com o boss, aguarde !")
return true
end
spec:remove()
end
for i = 1, #config.demonPositions do
Game.createMonster("Valkyrie Queen", 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)
player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce tem 10 minutos para matar o boss. Se morrer nao podera voltar!!")
end
elseif item.itemid == 1946 then
if config.daily then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
return true
end
end
item:transform(item.itemid == 25378 and 25378 or 25378)
return true
end
Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.