Postado Setembro 2, 2020 4 anos osh e o resto ta faltando uma parte vou estrutura pra tu e coloca la Spoiler local configWar = { MessageType = MESSAGE_INFO_DESCR, wallPos = {x=512,y=846,z=5,stackpos=1}, wallPos1 = {x=513,y=846,z=5,stackpos=1}, wallPos2 = {x=513,y=847,z=5,stackpos=1}, wallPos3 = {x=513,y=848,z=5,stackpos=1}, wallPos4 = {x=513,y=849,z=5,stackpos=1}, wallPos5 = {x=512,y=849,z=5,stackpos=1}, playerCount = getGlobalStorageValue(2001)+getGlobalStorageValue(2002), playersNeededToStartEvent = 2, AccessMessage = "Only Gods and Gamemasters can execute an event!", FirstMessage = "Event Notice!", SecondMessage = "War Arena has been opened to join go through the portal on the top floor of depot.", ThirdMessage = "War Arena will begin in 5 minutes!", FourthMessage = "War Arena will begin in 3 minutes!", ClosingMessage = "War Arena will close and begin in 1 minute!", CloseMessage = "War Arena portal has closed and the event has begun!" } setGlobalStorageValue(configWar.playerCount, 0) local waitingRoomFrompos = {x=617, y=625, z=7, stackpos=253} local waitingRoomTopos = {x=652, y=654, z=7, stackpos=253} --Functions for war. function EventNotice11(cid) addEvent(EventNotice21,5000,cid) doBroadcastMessage(configWar.FirstMessage,configWar.MessageType) end function EventNotice21(cid) addEvent(EventNotice31,10*1000,cid) doBroadcastMessage(configWar.SecondMessage,configWar.MessageType) end function EventNotice31(cid) addEvent(EventNotice41,120*1000,cid) doBroadcastMessage(configWar.ThirdMessage,configWar.MessageType) end function EventNotice41(cid) addEvent(EventNotice51,120*1000,cid) doBroadcastMessage(configWar.FourthMessage,configWar.MessageType) end function EventNotice51(cid) addEvent(EventNotice61,60*1000,cid) doBroadcastMessage(configWar.ClosingMessage,configWar.MessageType) end function EventNotice61(cid) doCreateItem(1600,1,configWar.wallPos) doCreateItem(1595,1,configWar.wallPos1) doCreateItem(1596,1,configWar.wallPos2) doCreateItem(1596,1,configWar.wallPos3) doCreateItem(1601,1,configWar.wallPos4) doCreateItem(1600,1,configWar.wallPos5) doBroadcastMessage(configWar.CloseMessage,configWar.MessageType) addEvent(BeginWAR,5*1000,cid) end --Start for War Event function BeginWAR(cid) local player = 0 local players = {} for _, pid in ipairs(getPlayersOnline()) do if isInArea(getPlayerPosition(pid), waitingRoomFrompos, waitingRoomTopos) then player = player + 1 players[player] = pid end end if player < 1 then for _, pid in pairs(players) do doTeleportThing(pid,POS_TEMPLE) end doCreateItem(1600,1,configWar.wallPos) doCreateItem(1595,1,configWar.wallPos1) doCreateItem(1596,1,configWar.wallPos2) doCreateItem(1596,1,configWar.wallPos3) doCreateItem(1601,1,configWar.wallPos4) doCreateItem(1600,1,configWar.wallPos5) doBroadcastMessage("Evento nao pode iniciar por falta de players.",configWar.MessageType) return true end for _, pid in ipairs(getPlayersOnline()) do count = getGlobalStorageValue(1511) if isInArea(getPlayerPosition(pid), waitingRoomFrompos, waitingRoomTopos) then setGlobalStorageValue(1511,count+1) doTeleportThing(pid, {x=635,y=614,z=7,stackpos=1}, false) end end end function SetEventWAR(cid) setGlobalStorageValue(1005, 0)--WAR end local WAR = 0 local eventType = getGlobalStorageValue(1005) function onThink(cid, item, fromPosition, toPosition) if getGlobalStorageValue(1005) <= WAR then doRemoveItem(getThingFromPos(configWar.wallPos).uid,1) doRemoveItem(getThingFromPos(configWar.wallPos1).uid,1) doRemoveItem(getThingFromPos(configWar.wallPos2).uid,1) doRemoveItem(getThingFromPos(configWar.wallPos3).uid,1) doRemoveItem(getThingFromPos(configWar.wallPos4).uid,1) doRemoveItem(getThingFromPos(configWar.wallPos5).uid,1) setGlobalStorageValue(1005, 0) setGlobalStorageValue(2001, 0) setGlobalStorageValue(2002, 0) setGlobalStorageValue(1511, 0) addEvent(EventNotice11,2000,cid) setGlobalStorageValue(28000, os.time(t)) end return true end Discord: Naze#3578 Ter Linux Dentro de Windows com Acesso 'localhost' para testes e + AutoLoot Otimizado Direto na Source (tfs 0.4/otx) // Pirataria é crime, original é roubo, compartilhar é legal.
Postado Setembro 2, 2020 4 anos Autor @Naze boa noite meu amigo! acabei de fazer o teste, e até deu certo, mas tanto com 1 player ou 2 players ele cancela o evento por falta de player.
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.