changos
-
Total de itens
13 -
Registro em
-
Última visita
-
tem uma script de movement que o player desloga ao entrar em X portal?
- Mostrar comentários anteriores %s mais
-
Citar
_Lib_Battle_Info = {
Reward = {2160,100},
TeamOne = {name = "Hashirama", storage = 140120, pos = {x=1051,y=1556,z=6}},
TeamTwo = {name = "Madara",storage = 140121,pos = {x=1049,y=1556,z=6}},
storage_count = 180400,
tpPos = {x=1021, y=1017, z=8},
limit_Time = 3 -- em minutos
}function resetBattle()
return setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) and setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)
endfunction OpenWallBattle()
local B = {
-- WALLS
{6839,{x=1050, y=1554, z=6, stackpos = 1}},
{6839,{x=1050, y=1555, z=6, stackpos = 1}},
{6839,{x=1050, y=1556, z=6, stackpos = 1}},
{6839,{x=1050, y=1557, z=6, stackpos = 1}},
{6839,{x=1050, y=1558, z=6, stackpos = 1}},
{6841,{x=1050, y=1553, 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
endfunction 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
endfunction 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)
endfunction 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.." Jogador"..(#players > 1 and "es" or "").." do time "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." ganharam o evento Battlefield e receberam ".._Lib_Battle_Info.Reward[2].." "..getItemNameById(_Lib_Battle_Info.Reward[1]).." + ".._Lib_Battle_Info.Reward2[2].." "..getItemNameById(_Lib_Battle_Info.Reward2[1]).."!"
for i = 1, #players do
doPlayerAddItem(players, _Lib_Battle_Info.Reward[1], _Lib_Battle_Info.Reward[2])
doPlayerAddItem(players, _Lib_Battle_Info.Reward2[1], _Lib_Battle_Info.Reward2[2])
doRemoveCondition(players, CONDITION_OUTFIT)
doTeleportThing(players, getTownTemplePosition(getPlayerTown(players)))
setPlayerStorageValue(players, storage, -1)
end
resetBattle()
OpenWallBattle()
return doBroadcastMessage(str)
endfunction CheckEvent(delay)
if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
doBroadcastMessage("[BattleField] Estamos à espera de "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." jogadores para o Battlefield iniciar.")
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("O evento Battlefield não iniciou por não ter jogadores suficientes.")
setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)
resetBattle()
removeBattleTp()
end
addEvent(CheckEvent, 60000, delay-1)
endcreio que o problema possa estar aqui na lib,mas se precisar de outra script eu mandarei,Obrigado pela atenção e ajuda manito