Ir para conteúdo

Featured Replies

Postado

Queria Saber se esse script da pra deixa automatico \/

 

 

 

 

 

 

 

 

 

 

local THRONE_POS = {x = 561, y = 446, z = 5}
local STORAGE_EVENT = 83902
local STORAGE_PLAYER = 73289
local DUR = 10 -- in minutes
function OpenEvent()
          for _, tid in ipairs(getPlayersOnline()) do
                    setPlayerStorageValue(tid, STORAGE_PLAYER, 1)
          end
          setGlobalStorageValue(STORAGE_EVENT, 1)
          doBroadcastMessage("O Evento castle foi aberto.", 25)
end
function getWinnerCastle(cid)
          CastleWalls()
          local player = getTopCreature(THRONE_POS).uid
          if getGlobalStorageValue(STORAGE_EVENT) < 0 then
                    return true
          end
          if (isPlayer(player)) then
                    if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
                              pid = getPlayerGUID(cid)
                              setHouseOwner(6258, pid)
                              doPlayerAddPremiumDays(player, 7)
                              for _, cid in ipairs(getPlayersOnline()) do
                                        setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                              end
                              doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25)
                              doTeleportThing(player, {x = 531, y = 460, z = 7})
                              doCreateItem(391, 1, {x = 500, y = 500, z = 7})
                    end
          else
                    doBroadcastMessage("Ningúem ganhou o evento.", 27)
                    for _, pid in ipairs(getPlayersOnline()) do
                              setPlayerStorageValue(pid, STORAGE_PLAYER, 0)
                              doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                    end
          end
          setGlobalStorageValue(STORAGE_EVENT, 0)
          return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER)
end
function CastleWalls()
          local pedra = getTileItemById({ x = 539, y = 474, z = 7}, 1285)
          local escada = getTileItemById({ x = 539, y = 474, z = 7}, 3687)
          if pedra.uid > 0 then
                    return doRemoveItem(pedra.uid)
          else
                    return doCreateItem(1285, 1, { x = 500, y = 500, z = 7})
          end
          if escada.uid > 0 then
                    return doRemoveItem(escada.uid)
          else
                    return doCreateItem(3687, 1, {x = 500, y = 500, z = 7})
          end
end
function onSay(cid, words, param, channel)
          if ((param == "abrir") and (getGlobalStorageValue(STORAGE_EVENT) == 1)) then
                    doPlayerSendTextMessage(cid, 27, "O evento já esta aberto.") return true
          elseif ((param == "fechar") and (getGlobalStorageValue(STORAGE_EVENT) == 1)) then
                    getWinnerCastle()
                    CastleWalls()
                    return true
          end
          doCreateItem(3687, 1, {x = 500, y = 500, z = 7})
          OpenEvent()
          CastleWalls()
          addEvent(getWinnerCastle, DUR * 60 * 1000)
          return true
end
  • Respostas 12
  • Visualizações 702
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Lembrando que é um globalevent agora... local function getWinnerCastle(cid) local THRONE_POS = {x = 561, y = 446, z = 5} local DUR = 10 -- in minutes           CastleWalls()           local player =

  • Qual é esse erro exatamente ?? 

  • <globalevent name="castle" interval="30" event="script" value="castle.lua"/>

Postado

Lembrando que é um globalevent agora...

local function getWinnerCastle(cid)
local THRONE_POS = {x = 561, y = 446, z = 5}
local DUR = 10 -- in minutes
          CastleWalls()
          local player = getTopCreature(THRONE_POS).uid
          if getGlobalStorageValue(STORAGE_EVENT) < 0 then
                    return true
          end
          if (isPlayer(player)) then
                    if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
                              pid = getPlayerGUID(cid)
                              setHouseOwner(6258, pid)
                              doPlayerAddPremiumDays(player, 7)
                              for _, cid in ipairs(getPlayersOnline()) do
                                        setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                              end
                              doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25)
                              doTeleportThing(player, {x = 531, y = 460, z = 7})
                              doCreateItem(391, 1, {x = 500, y = 500, z = 7})
                    end
          else
                    doBroadcastMessage("Ningúem ganhou o evento.", 27)
                    for _, pid in ipairs(getPlayersOnline()) do
                              setPlayerStorageValue(pid, STORAGE_PLAYER, 0)
                              doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                    end
          end
          setGlobalStorageValue(STORAGE_EVENT, 0)
          return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER)
end
local function OpenEvent()
local STORAGE_EVENT = 83902
local STORAGE_PLAYER = 73289
          for _, tid in ipairs(getPlayersOnline()) do
                    setPlayerStorageValue(tid, STORAGE_PLAYER, 1)
          end
          setGlobalStorageValue(STORAGE_EVENT, 1)
          doBroadcastMessage("O Evento castle foi aberto.", 25)
end
local function CastleWalls()
          local pedra = getTileItemById({ x = 539, y = 474, z = 7}, 1285)
          local escada = getTileItemById({ x = 539, y = 474, z = 7}, 3687)
          if pedra.uid > 0 then
                    return doRemoveItem(pedra.uid)
          else
                    return doCreateItem(1285, 1, { x = 500, y = 500, z = 7})
          end
          if escada.uid > 0 then
                    return doRemoveItem(escada.uid)
          else
                    return doCreateItem(3687, 1, {x = 500, y = 500, z = 7})
          end
end
function onThink(cid, interval, lastexecution)
local times = {
["12:00"] = {date="Saturday"},
["14:00"] = {date="Sunday"}
}
if getGlobalStorageValue(19234, 1) then return false end
if times[hours] ~= false and os.date("%A") == times[hours].date then
doCreateItem(3687, 1, {x = 500, y = 500, z = 7})
OpenEvent()
CastleWalls()
addEvent(getWinnerCastle, DUR * 60 * 1000)
addEvent(function () setGlobalStorageValue(19234, 1) end, os.clock()+600)
end
return true
end

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

Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais...

________________________________________________________________________________

Minhas Sprites:

Mega Metagross

Mega Abomasnow

Pack de Shinys

[Posso atualizá-lo com novos shinys a qualquer momento]

Tutoriais:

[Completo] Criando e adicionando um novo Pokémon

[Actions] Criando quest no RME

Editores Lua/Xml/Sync Entre outros:

Editores Win/Mac/Linux

Postado

Qual é esse erro exatamente ??  -.-

Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais...

________________________________________________________________________________

Minhas Sprites:

Mega Metagross

Mega Abomasnow

Pack de Shinys

[Posso atualizá-lo com novos shinys a qualquer momento]

Tutoriais:

[Completo] Criando e adicionando um novo Pokémon

[Actions] Criando quest no RME

Editores Lua/Xml/Sync Entre outros:

Editores Win/Mac/Linux

Postado
  • Autor

[13/07/2015 15:29:26] [Warning - Event::loadScript] Event onStartup not found (data/globalevents/scripts/castle.lua)

 

 

tem como dizer uma tag tb pq sou ruim pra esas coisas

Editado por Xandinhorasta (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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo