Postado Janeiro 14, 2013 12 anos Olá pessoal, o evento Battlefield que possuo está com um problema: Quando o evento termina, o time vencedor não é teleportado e nem ganha o premio. Alguém poderia me ajudar? Script: _Lib_Battle_Info = { Reward = {2160,10}, TeamOne = {name = "Black Assassins", storage = 150220, pos = {x=1006,y=1039,z=7}}, TeamTwo = {name = "Red Barbarians",storage = 150221,pos = {x=1044,y=1039,z=7}}, storage_count = 185400, tpPos = {x=32339, y=32213, 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=1025, y=1040, z=6, stackpos = 1}}, {3517,{x=1025, y=1041, z=6, stackpos = 1}}, {3517,{x=1025, y=1042, z=6, stackpos = 1}}, {3517,{x=1025, y=1043, z=6, 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) 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[i],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[i], _Lib_Battle_Info.Reward[1], _Lib_Battle_Info.Reward[2]) doRemoveCondition(players[i], CONDITION_OUTFIT) doTeleportThing(players[i], getTownTemplePosition(getPlayerTown(players[i]))) setPlayerStorageValue(players[i], 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[i], CONDITION_OUTFIT) doTeleportThing(players[i], getTownTemplePosition(getPlayerTown(players[i]))) setPlayerStorageValue(players[i], getPlayerStorageValue(players[i], _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
Postado Janeiro 14, 2013 12 anos Pow quem puder ajudar respect +++++++++++ meu evento ta instalado tudo perfeitinho mais tambem ta acontecendo isso Mais vale a lagrima da derrota doque a Covardia de não ter lutado , Prefiro morrer de Pé do que sempre viver ajoelhado. Kaio santos "soldier killed"
Postado Abril 8, 2014 11 anos Creio que não são so voces mais como todos que utiliza o script que o Vodkart postou aqui no TK, pois eu to usando o que ele postou e esta com esse mesmo problema, se alguem pode ajduar agradeço!
Postado Setembro 17, 2015 9 anos estou com o mesmo problema, o evento funciona no maximo uma vez depois nao tira mais o vencedores da arena, uso o tfs 0.4 dev
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.