Ir para conteúdo

Featured Replies

Postado

meu unico bug é que o tp nao dividi mto corretamente os time fica tipo , eu coloco 10 , fica 6 pro red e 4 pro preto , e alguns player nao da pra atacar n sei pq

Ok, poste o script dele.
  • Respostas 6
  • Visualizações 417
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
_Lib_Battle_Info = {
Reward = {2160,20},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=18939,y=18912,z=6}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=18926,y=18912,z=6}},
storage_count = 180400,
tpPos = {x=32369, y=32248, 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 = {
{1196,{x=18934, y=18923, z=6, stackpos = 1}},
{1196,{x=18934, y=18924, z=6, stackpos = 1}},
{1196,{x=18934, y=18925, z=6, stackpos = 1}},
{1196,{x=18934, y=18926, 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
 
 
 
acho que é esse ..

UPPPPPPPPPPPPPPPPP


galera , descobri outra coisa é assim entrei com 1 char de teste no tp , foi para o time red , entrei com outro dps, ele foi para o red de novo , ai entrei com o terceiro player ele foi para o black e depois , red e black , ai o maximo era 6 no evento , ficou 4x2 , ai eu fui atacar com 1 char do time black dei um vis hur com o char , ele matou 3 do red e acabou o evento, resumindo , o char a mais que tava no time red ele nao podia atacar os preto pq falava que era do mesmo time e nem atacar o proprio vermelho pq realmente era do mesmo time ai esse char n podia atacar ngm e nem fazer nada, mas qnd matei os 3 vermelho la que foram normal o evento terminou e esse que tava no time red (time que perdeu) que n podia atacar ngm ganhou a recompensa como se estivesse no black , algueém ajuda ? só é esse o bugzinho o resto da de boa :/

Editado por davidmr (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