Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Boa Noite Pessoal, estou com um problema no meu battle field, já tentei diversos scripts e não consegui solucionar;

Pois bem, no battle field event tem aquela "parede" que quando o game iniciará elas irão sumir, porem elas n somem, ja tentei remove-las pelo RME e deixa-las, mas mesmo assim nada acontece, o evento esta funcionando perfeitamente, porem com esse pequeno detalhe, gostaria que me ajudassem para eu poder colocar meu otserv online o quanto antes... ficarei grato REP+

NO CASO SERIA BATTLELIB, OBS: posições estão corretas e o id da parede também, OT Baiak 8.6 TFS: 0.4.1

Meu Script :

Spoiler

_Lib_Battle_Info = {
Reward = {1984,1},
TeamOne = {name = "Green Barbarians", storage = 140120, pos = {x=266,y=12,z=6}}, 
TeamTwo = {name = "Red Wizards",storage = 140121,pos = {x=248,y=12,z=6}}, 
storage_count = 180400,
tpPos = {x=153, y=43, z=7},
limit_Time = 10 -- em minutos
}

function resetBattle()
return setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) and setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)
end

function OpenWallBattle()
local B = {
{3517,{x=303, y=107, z=6, stackpos = 1}},
{3517,{x=303, y=107, z=6, stackpos = 1}},
{3517,{x=303, y=107, z=6, stackpos = 1}},
{3517,{x=303, y=107, z=6, 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)
local players = {}
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
table.insert(players, cid)
end
end
for i = 1, #players do
doPlayerSendTextMessage(players,type,msg)
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 players,str = {},""
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, storage) == 1 then
table.insert(players, cid)
end
end
str = str .. ""..#players.." Player"..(#players > 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, they received a ".._Lib_Battle_Info.Reward[2].." "..getItemNameById(_Lib_Battle_Info.Reward[1]).."!"
for i = 1, #players do
doPlayerAddItem(players, _Lib_Battle_Info.Reward[1], _Lib_Battle_Info.Reward[2])
doRemoveCondition(players, CONDITION_OUTFIT)
doTeleportThing(players, getTownTemplePosition(getPlayerTown(players)))
setPlayerStorageValue(players, storage, -1)
end
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
local players = {}
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
table.insert(players, cid)
end
end
for i = 1, #players do
doRemoveCondition(players, CONDITION_OUTFIT)
doTeleportThing(players, getTownTemplePosition(getPlayerTown(players)))
setPlayerStorageValue(players, getPlayerStorageValue(players, _Lib_Battle_Info.TeamOne.storage) == 1 and _Lib_Battle_Info.TeamOne.storage or _Lib_Battle_Info.TeamTwo.storage, -1)
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

 

ERRO no Console

 

Spoiler

04/04/2016 20:34:56] Henrique Zera has logged in.
[04/04/2016 20:36:41] > Broadcasted message: "The event BattleField was opened and We are waiting 2 Players! Team divided into 1 VS 1".
[04/04/2016 20:37:36] Henriqeuee has logged in.
[04/04/2016 20:37:41] > Broadcasted message: "[BattleField Event] We are waiting 1 players to Battlefield starts".
[04/04/2016 20:37:45] > Broadcasted message: "Battlefield will start in 2 minutes, please create your strategy!".
[04/04/2016 20:39:44] > Broadcasted message: "BattleField will begin now!".
 

 

[04/04/2016 20:41:16] [Error - CreatureScript Interface] 
[04/04/2016 20:41:16] data/creaturescripts/scripts/BattleCreatureScript.lua:onPrepareDeath
[04/04/2016 20:41:16] Description: 
[04/04/2016 20:41:16] (luaDoCreateItem) Tile not found

 


[04/04/2016 20:39:45] [Error - MoveEvents Interface] 
[04/04/2016 20:39:45] In a timer event called from: 
[04/04/2016 20:39:45] data/movements/scripts/BattleMovements.lua:onStepIn
[04/04/2016 20:39:45] Description: 
[04/04/2016 20:39:45] (luaDoCreateItem) Tile not found

 

[04/04/2016 20:41:16] > Broadcasted message: "1 Player from team Red Wizards won the event battlefield, they received a 1 blue tome!".

 

Editado por HenriqueFisch13 (veja o histórico de edições)

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.6k

Informação Importante

Confirmação de Termo