Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Então galera, eu estou criando um otserver e tive um problema com esse evento battlefield.

O problema é que quando o evento acaba, os ganhadores não são teleportados para o templo. Gostaria de ajuda, pois entendo muito pouco sobre scripts. Obrigado
Ps: todo o script do evento ja está no link acima, mas se for preciso eu posto aqui também.

Link para o post
Compartilhar em outros sites
19 minutos atrás, bielmattos disse:

Então galera, eu estou criando um otserver e tive um problema com esse evento battlefield.

O problema é que quando o evento acaba, os ganhadores não são teleportados para o templo. Gostaria de ajuda, pois entendo muito pouco sobre scripts. Obrigado
Ps: todo o script do evento ja está no link acima, mas se for preciso eu posto aqui também.

 

Troque isso:

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

por isso:

local tab = {
	pos = {x = 1017, y = 1020, z = 7} -- posição x, y, z do seu templo
doTeleportThing(cid, tab.pos)

em data/lib/battlelib.lua

Link para o post
Compartilhar em outros sites
2 minutos atrás, bielmattos disse:

Então @Kemmlly, eu fiz isso e no meu server log aparece esse erro
NuBVWqC.png

Aonde você colocou essa parte que te mandei? Em que parte do script? Manda ele aí pra mim

Link para o post
Compartilhar em outros sites

@Kemmlly

 

eu botei de duas formas e todas as duas deram errado. Toda as duas em data/lib/Battlelib
Antes de eu mostrar o que fiz, que fique claro que sou um completo retartado em scripts (UHSAIUGSIAU)
A primeira foi dessa forma.

Spoiler

_Lib_Battle_Info = {
Reward = {
exp = {true, 1000000}, items = {true, 6527, 1}, premium_days = {false, 2}
},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=409,y=168,z=7}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=375,y=168,z=7}},
storage_count = 180400,
tpPos = {x=150, y=47, z=7},
local tab = {
    pos = {x = 160, y = 54, z = 7} -- posição x, y, z do seu templo

limit_Time = 10 -- limite de tempo para adentrar o evento
}
function resetBattle()
setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)
setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)
end
function OpenWallBattle()
local B = {
{9118,{x=385, y=157, z=6, stackpos = 1}},
{9118,{x=385, y=158, z=6, stackpos = 1}},
{9118,{x=385, y=159, z=6, stackpos = 1}},
{9118,{x=385, y=160, z=6, stackpos = 1}},
{9118,{x=385, y=161, z=6, stackpos = 1}},
{9118,{x=385, y=162, z=6, stackpos = 1}},
{9118,{x=396, y=157, z=6, stackpos = 1}},
{9118,{x=396, y=158, z=6, stackpos = 1}},
{9118,{x=396, y=159, z=6, stackpos = 1}},
{9118,{x=396, y=160, z=6, stackpos = 1}},
{9118,{x=396, y=161, z=6, stackpos = 1}},
{9118,{x=396, y=162, z=6, stackpos = 1}},
{3517,{x=392, y=171, z=6, stackpos = 1}},
{3517,{x=392, y=172, z=6, stackpos = 1}},
{3517,{x=392, y=173, z=6, stackpos = 1}},
{3517,{x=392, y=174, z=6, stackpos = 1}},
{1543,{x=186, y=57, z=7, stackpos = 1}}
}
for i = 1, #B do
if getTileItemById(B[2], B[1]).uid == 0 then
doCreateItem(B[1], 1, B[2])
else
doRemoveItem(getThingfromPos(B[2]).uid,1)
end
end
end
function doBroadCastBattle(type, msg)
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doPlayerSendTextMessage(cid,type,msg)
end
end
end
function removeBattleTp()
local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid
return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF)
end
function getWinnersBattle(storage)
local str, c = "" , 0
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, storage) == 1 then
if _Lib_Battle_Info.Reward.exp[1] == true then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end
if _Lib_Battle_Info.Reward.items[1] == true then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end
if _Lib_Battle_Info.Reward.premium_days[1] == true then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid, tab.pos)
setPlayerStorageValue(cid, storage, -1)
c = c+1 
end
end
str = str .. ""..c.." Player"..(c > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield!"
resetBattle()
OpenWallBattle()
return doBroadcastMessage(str)
end
function CheckEvent(delay)
if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
doBroadcastMessage("[BattleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts")
elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)
end
end
doBroadcastMessage("The event cannot be started because not had enough players.")
setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)
resetBattle()
removeBattleTp()
end
addEvent(CheckEvent, 60000, delay-1)
end

 

E a segunda foi dessa forma

 

Spoiler

_Lib_Battle_Info = {
Reward = {
exp = {true, 1000000}, items = {true, 6527, 1}, premium_days = {false, 2}
},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=409,y=168,z=7}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=375,y=168,z=7}},
storage_count = 180400,
tpPos = {x=150, y=47, z=7},
limit_Time = 10 -- limite de tempo para adentrar o evento
}
function resetBattle()
setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)
setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)
end
function OpenWallBattle()
local B = {
{9118,{x=385, y=157, z=6, stackpos = 1}},
{9118,{x=385, y=158, z=6, stackpos = 1}},
{9118,{x=385, y=159, z=6, stackpos = 1}},
{9118,{x=385, y=160, z=6, stackpos = 1}},
{9118,{x=385, y=161, z=6, stackpos = 1}},
{9118,{x=385, y=162, z=6, stackpos = 1}},
{9118,{x=396, y=157, z=6, stackpos = 1}},
{9118,{x=396, y=158, z=6, stackpos = 1}},
{9118,{x=396, y=159, z=6, stackpos = 1}},
{9118,{x=396, y=160, z=6, stackpos = 1}},
{9118,{x=396, y=161, z=6, stackpos = 1}},
{9118,{x=396, y=162, z=6, stackpos = 1}},
{3517,{x=392, y=171, z=6, stackpos = 1}},
{3517,{x=392, y=172, z=6, stackpos = 1}},
{3517,{x=392, y=173, z=6, stackpos = 1}},
{3517,{x=392, y=174, z=6, stackpos = 1}},
{1543,{x=186, y=57, z=7, stackpos = 1}}
}
for i = 1, #B do
if getTileItemById(B[2], B[1]).uid == 0 then
doCreateItem(B[1], 1, B[2])
else
doRemoveItem(getThingfromPos(B[2]).uid,1)
end
end
end
function doBroadCastBattle(type, msg)
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doPlayerSendTextMessage(cid,type,msg)
end
end
end
function removeBattleTp()
local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid
return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF)
end
function getWinnersBattle(storage)
local str, c = "" , 0
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, storage) == 1 then
if _Lib_Battle_Info.Reward.exp[1] == true then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end
if _Lib_Battle_Info.Reward.items[1] == true then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end
if _Lib_Battle_Info.Reward.premium_days[1] == true then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end
doRemoveCondition(cid, CONDITION_OUTFIT)
local tab = {
    pos = {x = 160, y = 54, z = 7} -- posição x, y, z do seu templo

doTeleportThing(cid, tab.pos)
setPlayerStorageValue(cid, storage, -1)
c = c+1 
end
end
str = str .. ""..c.." Player"..(c > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield!"
resetBattle()
OpenWallBattle()
return doBroadcastMessage(str)
end
function CheckEvent(delay)
if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
doBroadcastMessage("[BattleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts")
elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)
end
end
doBroadcastMessage("The event cannot be started because not had enough players.")
setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)
resetBattle()
removeBattleTp()
end
addEvent(CheckEvent, 60000, delay-1)
end

 

Link para o post
Compartilhar em outros sites
9 minutos atrás, bielmattos disse:

@Kemmlly

 

eu botei de duas formas e todas as duas deram errado. Toda as duas em data/lib/Battlelib
Antes de eu mostrar o que fiz, que fique claro que sou um completo retartado em scripts (UHSAIUGSIAU)
A primeira foi dessa forma.

  Ocultar conteúdo

_Lib_Battle_Info = {
Reward = {
exp = {true, 1000000}, items = {true, 6527, 1}, premium_days = {false, 2}
},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=409,y=168,z=7}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=375,y=168,z=7}},
storage_count = 180400,
tpPos = {x=150, y=47, z=7},
local tab = {
    pos = {x = 160, y = 54, z = 7} -- posição x, y, z do seu templo

limit_Time = 10 -- limite de tempo para adentrar o evento
}
function resetBattle()
setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)
setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)
end
function OpenWallBattle()
local B = {
{9118,{x=385, y=157, z=6, stackpos = 1}},
{9118,{x=385, y=158, z=6, stackpos = 1}},
{9118,{x=385, y=159, z=6, stackpos = 1}},
{9118,{x=385, y=160, z=6, stackpos = 1}},
{9118,{x=385, y=161, z=6, stackpos = 1}},
{9118,{x=385, y=162, z=6, stackpos = 1}},
{9118,{x=396, y=157, z=6, stackpos = 1}},
{9118,{x=396, y=158, z=6, stackpos = 1}},
{9118,{x=396, y=159, z=6, stackpos = 1}},
{9118,{x=396, y=160, z=6, stackpos = 1}},
{9118,{x=396, y=161, z=6, stackpos = 1}},
{9118,{x=396, y=162, z=6, stackpos = 1}},
{3517,{x=392, y=171, z=6, stackpos = 1}},
{3517,{x=392, y=172, z=6, stackpos = 1}},
{3517,{x=392, y=173, z=6, stackpos = 1}},
{3517,{x=392, y=174, z=6, stackpos = 1}},
{1543,{x=186, y=57, z=7, stackpos = 1}}
}
for i = 1, #B do
if getTileItemById(B[2], B[1]).uid == 0 then
doCreateItem(B[1], 1, B[2])
else
doRemoveItem(getThingfromPos(B[2]).uid,1)
end
end
end
function doBroadCastBattle(type, msg)
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doPlayerSendTextMessage(cid,type,msg)
end
end
end
function removeBattleTp()
local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid
return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF)
end
function getWinnersBattle(storage)
local str, c = "" , 0
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, storage) == 1 then
if _Lib_Battle_Info.Reward.exp[1] == true then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end
if _Lib_Battle_Info.Reward.items[1] == true then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end
if _Lib_Battle_Info.Reward.premium_days[1] == true then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid, tab.pos)
setPlayerStorageValue(cid, storage, -1)
c = c+1 
end
end
str = str .. ""..c.." Player"..(c > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield!"
resetBattle()
OpenWallBattle()
return doBroadcastMessage(str)
end
function CheckEvent(delay)
if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
doBroadcastMessage("[BattleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts")
elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)
end
end
doBroadcastMessage("The event cannot be started because not had enough players.")
setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)
resetBattle()
removeBattleTp()
end
addEvent(CheckEvent, 60000, delay-1)
end

 

E a segunda foi dessa forma

 

  Ocultar conteúdo

_Lib_Battle_Info = {
Reward = {
exp = {true, 1000000}, items = {true, 6527, 1}, premium_days = {false, 2}
},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=409,y=168,z=7}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=375,y=168,z=7}},
storage_count = 180400,
tpPos = {x=150, y=47, z=7},
limit_Time = 10 -- limite de tempo para adentrar o evento
}
function resetBattle()
setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)
setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)
end
function OpenWallBattle()
local B = {
{9118,{x=385, y=157, z=6, stackpos = 1}},
{9118,{x=385, y=158, z=6, stackpos = 1}},
{9118,{x=385, y=159, z=6, stackpos = 1}},
{9118,{x=385, y=160, z=6, stackpos = 1}},
{9118,{x=385, y=161, z=6, stackpos = 1}},
{9118,{x=385, y=162, z=6, stackpos = 1}},
{9118,{x=396, y=157, z=6, stackpos = 1}},
{9118,{x=396, y=158, z=6, stackpos = 1}},
{9118,{x=396, y=159, z=6, stackpos = 1}},
{9118,{x=396, y=160, z=6, stackpos = 1}},
{9118,{x=396, y=161, z=6, stackpos = 1}},
{9118,{x=396, y=162, z=6, stackpos = 1}},
{3517,{x=392, y=171, z=6, stackpos = 1}},
{3517,{x=392, y=172, z=6, stackpos = 1}},
{3517,{x=392, y=173, z=6, stackpos = 1}},
{3517,{x=392, y=174, z=6, stackpos = 1}},
{1543,{x=186, y=57, z=7, stackpos = 1}}
}
for i = 1, #B do
if getTileItemById(B[2], B[1]).uid == 0 then
doCreateItem(B[1], 1, B[2])
else
doRemoveItem(getThingfromPos(B[2]).uid,1)
end
end
end
function doBroadCastBattle(type, msg)
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doPlayerSendTextMessage(cid,type,msg)
end
end
end
function removeBattleTp()
local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid
return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF)
end
function getWinnersBattle(storage)
local str, c = "" , 0
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, storage) == 1 then
if _Lib_Battle_Info.Reward.exp[1] == true then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end
if _Lib_Battle_Info.Reward.items[1] == true then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end
if _Lib_Battle_Info.Reward.premium_days[1] == true then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end
doRemoveCondition(cid, CONDITION_OUTFIT)
local tab = {
    pos = {x = 160, y = 54, z = 7} -- posição x, y, z do seu templo

doTeleportThing(cid, tab.pos)
setPlayerStorageValue(cid, storage, -1)
c = c+1 
end
end
str = str .. ""..c.." Player"..(c > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield!"
resetBattle()
OpenWallBattle()
return doBroadcastMessage(str)
end
function CheckEvent(delay)
if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
doBroadcastMessage("[BattleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts")
elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)
end
end
doBroadcastMessage("The event cannot be started because not had enough players.")
setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)
resetBattle()
removeBattleTp()
end
addEvent(CheckEvent, 60000, delay-1)
end

 

Deixe todo o sistema do jeito que voce pegou do forum, mude apenas o BattleLib.lua por esse, apaga tudo e cola isso:

_Lib_Battle_Info = {
Reward = {
exp = {true, 100}, items = {true, 2160, 10}, premium_days = {true, 2}
},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=164,y=54,z=7}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=163,y=50,z=7}},
storage_count = 180400,
tpPos = {x=182, y=56, z=7},
limit_Time = 10 -- limite de tempo para adentrar o evento
}
function resetBattle()
setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)
setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)
end
function OpenWallBattle()
local B = {
{1543,{x=186, y=54, z=7, stackpos = 1}},
{1543,{x=186, y=55, z=7, stackpos = 1}},
{1543,{x=186, y=56, z=7, stackpos = 1}},
{1543,{x=186, y=57, z=7, stackpos = 1}}
}
for i = 1, #B do
if getTileItemById(B[i][2], B[i][1]).uid == 0 then
doCreateItem(B[i][1], 1, B[i][2])
else
doRemoveItem(getThingfromPos(B[i][2]).uid,1)
end
end
end
function doBroadCastBattle(type, msg)
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doPlayerSendTextMessage(cid,type,msg)
end
end
end
function removeBattleTp()
local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid
return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF)
end
function getWinnersBattle(storage)
local str, c = "" , 0
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, storage) == 1 then
if _Lib_Battle_Info.Reward.exp[1] == true then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end
if _Lib_Battle_Info.Reward.items[1] == true then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end
if _Lib_Battle_Info.Reward.premium_days[1] == true then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end
doRemoveCondition(cid, CONDITION_OUTFIT)
local tab = {
    pos = {x = 160, y = 54, z = 7} -- posição x, y, z do seu templo
    		}
doTeleportThing(cid, tab.pos)
setPlayerStorageValue(cid, storage, -1)
c = c+1 
end
end
str = str .. ""..c.." Player"..(c > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield!"
resetBattle()
OpenWallBattle()
return doBroadcastMessage(str)
end
function CheckEvent(delay)
if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
doBroadcastMessage("[BattleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts")
elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)
setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)
end
end
doBroadcastMessage("The event cannot be started because not had enough players.")
setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)
resetBattle()
removeBattleTp()
end
addEvent(CheckEvent, 60000, delay-1)
end

 

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo