Ir para conteúdo

Featured Replies

Postado

Boa noite,

 

Eu adicionei o script do Vodkart no meu ot, o famoso Battlefield, funcionou tudo corretamente, porem há um problema, o script funciona normal, ao matar os players, todos são teleportados para o templo e o time ganhador ganha os premios, porem as paredes que separam os times não são adicionadas novamente, elas somem quando começa o evento, porem quando termina, não são adicionadas novamente, então na próxima vez que o evento rodar, vai bugar, pq n vai ter a parede lá separando os times até o evento começar, abaixo segue o script da LIB:

 

_Lib_Battle_Info = {
Reward = {
exp = {false, 0}, items = {true, 9020, 50}, premium_days = {false, 0}
},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=32505,y=32540,z=7}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=32546,y=32538,z=7}},
storage_count = 180400,
tpPos = {x=32365, y=32232, z=7},
limit_Time = 5 -- 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 = {
{1541,{x=32525, y=32540, z=6, stackpos = 1}},
{1542,{x=32525, y=32541, z=6, stackpos = 1}},
{1543,{x=32525, y=32542, z=6, stackpos = 1}},
{1544,{x=32525, y=32543, z=6, stackpos = 1}},
{1545,{x=32518, y=32528, z=6, stackpos = 1}},
{1546,{x=32518, y=32529, z=6, stackpos = 1}},
{1547,{x=32529, y=32528, z=6, stackpos = 1}},
{1548,{x=32529, y=32529, z=6, stackpos = 1}}
}
for i = 1, #B do
if getTileItemById(B[i][2], B[i][1]).uid == 0 then
doRemoveItem(getThingfromPos(B[i][2]).uid,1)
else
doCreateItem(B[i][1], 1, B[i][2])
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, getTownTemplePosition(getPlayerTown(cid)))
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

Alguém poderia me ajudar por favor? preciso que essas paredes voltem a aparecer, nem que seja por meio de gambiarra.

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo