Ir para conteúdo

Featured Replies

Postado

Pessoal, boa noite!

Na hora de rodar a script do Killua Cave Exclusiva tenho me deparado com o seguinte erro:

 

Alguém poderia dar uma luz sobre o problema? TF 0.4

 

blob.thumb.png.3acd04e51f0fe94d958f8f14ab0e794b.png

 

 

GLOBALEVENTS:

 

Killua Cave Owners 2.lua

Spoiler

local function filtrateString(str)
    if type(str) ~= "string" then
        return false
    end
    local first, last = 0, 0
    local second, final = 0, #str
    for i = 1, #str do
        if string.byte(str:sub(i,i)) == string.byte('a') then
            first = i + 2
            for t = first, #str do
                if string.byte(str:sub(t,t)) == string.byte(' ') then
                    last = t - 1
                    break
                end
            end
        end
        if string.byte(str:sub(i,i)) == string.byte('b') then
            second = i + 2
        end
    end
    return {str:sub(first, last), str:sub(second, final)}
end

local f1, t1 = {x = 436, y = 2573, z = 7}, {x = 585, y = 2670, z = 7}
local f2, t2 = {x = 594, y = 2567, z = 7}, {x = 743, y = 2673, z = 7}
local f3, t3 = {x = 751, y = 2591, z = 7}, {x = 820, y = 2648, z = 7}
local f4, t4 = {x = 829, y = 2557, z = 7}, {x = 977, y = 2670, z = 7}
local f5, t5 = {x = 1004, y = 2607, z = 6}, {x = 1072, y = 2654, z = 6}
local f6, t6 = {x = 1096, y = 2576, z = 7}, {x = 1253, y = 2671, z = 7}
local f7, t7 = {x = 1270, y = 2572, z = 7}, {x = 1413, y = 2673, z = 7}
local f8, t8 = {x = 1428, y = 2596, z = 7}, {x = 1487, y = 2651, z = 7}
local f9, t9 = {x = 1504, y = 2570, z = 7}, {x = 1647, y = 2680, z = 7}
local f10, t10 = {x = 435, y = 2681, z = 7}, {x = 582, y = 2744, z = 7}
local f11, t11 = {x = 592, y = 2683, z = 7}, {x = 683, y = 2762, z = 7}
local f12, t12 = {x = 692, y = 2685, z = 7}, {x = 776, y = 2762, z = 7}
local f13, t13 = {x = 814, y = 2693, z = 9}, {x = 929, y = 2762, z = 9}
local f14, t14 = {x = 1000, y = 2704, z = 7}, {x = 1101, y = 2787, z = 7}
local f15, t15 = {x = 1132, y = 2712, z = 7}, {x = 1193, y = 2767, z = 7}
local f16, t16 = {x = 1213, y = 2690, z = 7}, {x = 1355, y = 2800, z = 7}
local f17, t17 = {x = 1377, y = 2702, z = 7}, {x = 1522, y = 2797, z = 7}
local f18, t18 = {x = 1538, y = 2700, z = 7}, {x = 1680, y = 2801, z = 7}

function onThink(interval, lastExecution)
local first = getPlayersInArea(f1, t1)
local second = getPlayersInArea(f2, t2)
local third = getPlayersInArea(f3, t3)
local fourth = getPlayersInArea(f4, t4)
local fifth = getPlayersInArea(f5, t5)
local sixth = getPlayersInArea(f6, t6)
local seventh = getPlayersInArea(f7, t7)
local eighth = getPlayersInArea(f8, t8)
local ninth = getPlayersInArea(f9, t9)
local tenth = getPlayersInArea(f10, t10)
local eleventh = getPlayersInArea(f11, t11)
local twelfth = getPlayersInArea(f12, t12)
local thirteenth = getPlayersInArea(f13, t13)
local fourteenth = getPlayersInArea(f14, t14)
local fifteenth = getPlayersInArea(f15, t15)
local sixteenth = getPlayersInArea(f16, t16)
local seventeenth = getPlayersInArea(f17, t17)
local eighteenth = getPlayersInArea(f18, t18)
    
    if first then
        for _, pid in pairs(first) do
            if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822081))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822081))[1]) and tonumber(filtrateString(getGlobalStorageValue(822081))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 1 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if second then
        for _, pid in pairs(second) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822082))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822082))[1]) and tonumber(filtrateString(getGlobalStorageValue(822082))[2]) <= os.time()    then
            doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 2 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if third then
        for _, pid in pairs(third) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822083))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822083))[1]) and tonumber(filtrateString(getGlobalStorageValue(822083))[2]) <= os.time() then
                        doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 3 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if fourth then
        for _, pid in pairs(fourth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822084))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822084))[1]) and tonumber(filtrateString(getGlobalStorageValue(822084))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 4 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if fifth then
        for _, pid in pairs(fifth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822085))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822085))[1]) and tonumber(filtrateString(getGlobalStorageValue(822085))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 5 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if sixth then
        for _, pid in pairs(sixth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822086))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822086))[1]) and tonumber(filtrateString(getGlobalStorageValue(822086))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 6 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if seventh then
        for _, pid in pairs(seventh) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822087))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822087))[1]) and tonumber(filtrateString(getGlobalStorageValue(822087))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 7 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if eighth then
        for _, pid in pairs(eighth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822088))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822088))[1]) and tonumber(filtrateString(getGlobalStorageValue(822088))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 8 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if ninth then
        for _, pid in pairs(ninth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822089))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822089))[1]) and tonumber(filtrateString(getGlobalStorageValue(822089))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 9 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if tenth then
        for _, pid in pairs(tenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822090))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822090))[1]) and tonumber(filtrateString(getGlobalStorageValue(822090))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 10 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if eleventh then
        for _, pid in pairs(eleventh) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822091))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822091))[1]) and tonumber(filtrateString(getGlobalStorageValue(822091))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 11 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if twelfth then
        for _, pid in pairs(twelfth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822092))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822092))[1]) and tonumber(filtrateString(getGlobalStorageValue(822092))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 12 expirou. Você foi levado até seu templo.")
            end
        end
    end
            if thirteenth then
        for _, pid in pairs(thirteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822093))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822093))[1]) and tonumber(filtrateString(getGlobalStorageValue(822093))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 13 expirou. Você foi levado até seu templo.")
            end
        end
    end
            if fourteenth then
        for _, pid in pairs(fourteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822094))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822094))[1]) and tonumber(filtrateString(getGlobalStorageValue(822094))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 14 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if fifteenth then
        for _, pid in pairs(fifteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822095))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822095))[1]) and tonumber(filtrateString(getGlobalStorageValue(822095))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 15 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if sixteenth then
        for _, pid in pairs(sixteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822096))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822096))[1]) and tonumber(filtrateString(getGlobalStorageValue(822096))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 16 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if seventeenth then
        for _, pid in pairs(seventeenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822097))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822097))[1]) and tonumber(filtrateString(getGlobalStorageValue(822097))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 17 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if eighteenth then
        for _, pid in pairs(eighteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822098))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822098))[1]) and tonumber(filtrateString(getGlobalStorageValue(822098))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 18 expirou. Você foi levado até seu templo.")
            end
        end
    end


    return true
end
    

 

Killua Cave Owners.lua

Spoiler

local function filtrateString(str)
    if type(str) ~= "string" then
        return false
    end
    local first, last = 0, 0
    local second, final = 0, #str
    for i = 1, #str do
        if string.byte(str:sub(i,i)) == string.byte('a') then
            first = i + 2
            for t = first, #str do
                if string.byte(str:sub(t,t)) == string.byte(' ') then
                    last = t - 1
                    break
                end
            end
        end
        if string.byte(str:sub(i,i)) == string.byte('b') then
            second = i + 2
        end
    end
    return {str:sub(first, last), str:sub(second, final)}
end

function onStartup()
    if not filtrateString(getGlobalStorageValue(822081)) then
        setGlobalStorageValue(822081, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822082)) then
        setGlobalStorageValue(822082, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822083)) then
        setGlobalStorageValue(822083, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822084)) then
        setGlobalStorageValue(822084, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822085)) then
        setGlobalStorageValue(822085, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822086)) then
        setGlobalStorageValue(822086, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822087)) then
        setGlobalStorageValue(822087, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822088)) then
        setGlobalStorageValue(822088, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822089)) then
        setGlobalStorageValue(822089, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822090)) then
        setGlobalStorageValue(822090, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822091)) then
        setGlobalStorageValue(822091, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822092)) then
        setGlobalStorageValue(822092, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822093)) then
        setGlobalStorageValue(822093, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822094)) then
        setGlobalStorageValue(822094, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822095)) then
        setGlobalStorageValue(822095, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822096)) then
        setGlobalStorageValue(822096, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822097)) then
        setGlobalStorageValue(822097, "a 123 b 456")
    end
    if not filtrateString(getGlobalStorageValue(822098)) then
        setGlobalStorageValue(822098, "a 123 b 456")
    end


    local query = db.getResult("SELECT `guild_id` FROM `castle_dono` WHERE `guild_id` > 0")
    if query:getID() ~= -1 then
        setGlobalStorageValue(1823999, query:getDataInt("guild_id"))
    end
    return true
end

 

 

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

Postado
  • Autor
8 minutos atrás, Firulis disse:

Publique seu script, parece que há um erro quando está tentando obter a posição da hunt ( NIL Value)

Eu coloquei as duas scripts do globalevents no spoiler :\

Postado

@crk

 

Spoiler

local function filtrateString(str)
    if type(str) ~= "string" then
        return false
    end
    local first, last = 0, 0
    local second, final = 0, #str
    for i = 1, #str do
        if string.byte(str:sub(i,i)) == string.byte('a') then
            first = i + 2
            for t = first, #str do
                if string.byte(str:sub(t,t)) == string.byte(' ') then
                    last = t - 1
                    break
                end
            end
        end
        if string.byte(str:sub(i,i)) == string.byte('b') then
            second = i + 2
        end
    end
    return {str:sub(first, last), str:sub(second, final)}
end
local f1, t1 = {x = 436, y = 2573, z = 7}, {x = 585, y = 2670, z = 7}
local f2, t2 = {x = 594, y = 2567, z = 7}, {x = 743, y = 2673, z = 7}
local f3, t3 = {x = 751, y = 2591, z = 7}, {x = 820, y = 2648, z = 7}
local f4, t4 = {x = 829, y = 2557, z = 7}, {x = 977, y = 2670, z = 7}
local f5, t5 = {x = 1004, y = 2607, z = 6}, {x = 1072, y = 2654, z = 6}
local f6, t6 = {x = 1096, y = 2576, z = 7}, {x = 1253, y = 2671, z = 7}
local f7, t7 = {x = 1270, y = 2572, z = 7}, {x = 1413, y = 2673, z = 7}
local f8, t8 = {x = 1428, y = 2596, z = 7}, {x = 1487, y = 2651, z = 7}
local f9, t9 = {x = 1504, y = 2570, z = 7}, {x = 1647, y = 2680, z = 7}
local f10, t10 = {x = 435, y = 2681, z = 7}, {x = 582, y = 2744, z = 7}
local f11, t11 = {x = 592, y = 2683, z = 7}, {x = 683, y = 2762, z = 7}
local f12, t12 = {x = 692, y = 2685, z = 7}, {x = 776, y = 2762, z = 7}
local f13, t13 = {x = 814, y = 2693, z = 9}, {x = 929, y = 2762, z = 9}
local f14, t14 = {x = 1000, y = 2704, z = 7}, {x = 1101, y = 2787, z = 7}
local f15, t15 = {x = 1132, y = 2712, z = 7}, {x = 1193, y = 2767, z = 7}
local f16, t16 = {x = 1213, y = 2690, z = 7}, {x = 1355, y = 2800, z = 7}
local f17, t17 = {x = 1377, y = 2702, z = 7}, {x = 1522, y = 2797, z = 7}
local f18, t18 = {x = 1538, y = 2700, z = 7}, {x = 1680, y = 2801, z = 7}
function onThink(interval, lastExecution)
local first = getPlayersInArea(f1, t1)
local second = getPlayersInArea(f2, t2)
local third = getPlayersInArea(f3, t3)
local fourth = getPlayersInArea(f4, t4)
local fifth = getPlayersInArea(f5, t5)
local sixth = getPlayersInArea(f6, t6)
local seventh = getPlayersInArea(f7, t7)
local eighth = getPlayersInArea(f8, t8)
local ninth = getPlayersInArea(f9, t9)
local tenth = getPlayersInArea(f10, t10)
local eleventh = getPlayersInArea(f11, t11)
local twelfth = getPlayersInArea(f12, t12)
local thirteenth = getPlayersInArea(f13, t13)
local fourteenth = getPlayersInArea(f14, t14)
local fifteenth = getPlayersInArea(f15, t15)
local sixteenth = getPlayersInArea(f16, t16)
local seventeenth = getPlayersInArea(f17, t17)
local eighteenth = getPlayersInArea(f18, t18)
    
    if first then
        for _, pid in pairs(first) do
            if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822081))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822081))[1]) and tonumber(filtrateString(getGlobalStorageValue(822081))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 1 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if second then
        for _, pid in pairs(second) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822082))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822082))[1]) and tonumber(filtrateString(getGlobalStorageValue(822082))[2]) <= os.time()    then
            doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 2 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if third then
        for _, pid in pairs(third) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822083))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822083))[1]) and tonumber(filtrateString(getGlobalStorageValue(822083))[2]) <= os.time() then
                        doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 3 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if fourth then
        for _, pid in pairs(fourth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822084))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822084))[1]) and tonumber(filtrateString(getGlobalStorageValue(822084))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 4 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if fifth then
        for _, pid in pairs(fifth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822085))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822085))[1]) and tonumber(filtrateString(getGlobalStorageValue(822085))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 5 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if sixth then
        for _, pid in pairs(sixth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822086))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822086))[1]) and tonumber(filtrateString(getGlobalStorageValue(822086))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 6 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if seventh then
        for _, pid in pairs(seventh) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822087))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822087))[1]) and tonumber(filtrateString(getGlobalStorageValue(822087))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 7 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if eighth then
        for _, pid in pairs(eighth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822088))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822088))[1]) and tonumber(filtrateString(getGlobalStorageValue(822088))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 8 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if ninth then
        for _, pid in pairs(ninth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822089))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822089))[1]) and tonumber(filtrateString(getGlobalStorageValue(822089))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 9 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if tenth then
        for _, pid in pairs(tenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822090))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822090))[1]) and tonumber(filtrateString(getGlobalStorageValue(822090))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 10 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if eleventh then
        for _, pid in pairs(eleventh) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822091))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822091))[1]) and tonumber(filtrateString(getGlobalStorageValue(822091))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 11 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if twelfth then
        for _, pid in pairs(twelfth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822092))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822092))[1]) and tonumber(filtrateString(getGlobalStorageValue(822092))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 12 expirou. Você foi levado até seu templo.")
            end
        end
    end
            if thirteenth then
        for _, pid in pairs(thirteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822093))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822093))[1]) and tonumber(filtrateString(getGlobalStorageValue(822093))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 13 expirou. Você foi levado até seu templo.")
            end
        end
    end
            if fourteenth then
        for _, pid in pairs(fourteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822094))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822094))[1]) and tonumber(filtrateString(getGlobalStorageValue(822094))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 14 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if fifteenth then
        for _, pid in pairs(fifteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822095))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822095))[1]) and tonumber(filtrateString(getGlobalStorageValue(822095))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 15 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if sixteenth then
        for _, pid in pairs(sixteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822096))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822096))[1]) and tonumber(filtrateString(getGlobalStorageValue(822096))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 16 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if seventeenth then
        for _, pid in pairs(seventeenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822097))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822097))[1]) and tonumber(filtrateString(getGlobalStorageValue(822097))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 17 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if eighteenth then
        for _, pid in pairs(eighteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822098))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822098))[1]) and tonumber(filtrateString(getGlobalStorageValue(822098))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 18 expirou. Você foi levado até seu templo.")
            end
        end
    end

    return true
end

function getPlayersInArea(fromPos, toPos)
local players = {}
      for _, pid in ipairs(getPlayersOnline()) do
          if isInRange(getPlayerPosition(pid), fromPos, toPos) then
             table.insert(players, pid)
          end
      end
      return players
end

 

 

Contato:

 

Postado
  • Autor
20 minutos atrás, Dwarfer disse:

@crk

 

  Mostrar conteúdo oculto


local function filtrateString(str)
    if type(str) ~= "string" then
        return false
    end
    local first, last = 0, 0
    local second, final = 0, #str
    for i = 1, #str do
        if string.byte(str:sub(i,i)) == string.byte('a') then
            first = i + 2
            for t = first, #str do
                if string.byte(str:sub(t,t)) == string.byte(' ') then
                    last = t - 1
                    break
                end
            end
        end
        if string.byte(str:sub(i,i)) == string.byte('b') then
            second = i + 2
        end
    end
    return {str:sub(first, last), str:sub(second, final)}
end
local f1, t1 = {x = 436, y = 2573, z = 7}, {x = 585, y = 2670, z = 7}
local f2, t2 = {x = 594, y = 2567, z = 7}, {x = 743, y = 2673, z = 7}
local f3, t3 = {x = 751, y = 2591, z = 7}, {x = 820, y = 2648, z = 7}
local f4, t4 = {x = 829, y = 2557, z = 7}, {x = 977, y = 2670, z = 7}
local f5, t5 = {x = 1004, y = 2607, z = 6}, {x = 1072, y = 2654, z = 6}
local f6, t6 = {x = 1096, y = 2576, z = 7}, {x = 1253, y = 2671, z = 7}
local f7, t7 = {x = 1270, y = 2572, z = 7}, {x = 1413, y = 2673, z = 7}
local f8, t8 = {x = 1428, y = 2596, z = 7}, {x = 1487, y = 2651, z = 7}
local f9, t9 = {x = 1504, y = 2570, z = 7}, {x = 1647, y = 2680, z = 7}
local f10, t10 = {x = 435, y = 2681, z = 7}, {x = 582, y = 2744, z = 7}
local f11, t11 = {x = 592, y = 2683, z = 7}, {x = 683, y = 2762, z = 7}
local f12, t12 = {x = 692, y = 2685, z = 7}, {x = 776, y = 2762, z = 7}
local f13, t13 = {x = 814, y = 2693, z = 9}, {x = 929, y = 2762, z = 9}
local f14, t14 = {x = 1000, y = 2704, z = 7}, {x = 1101, y = 2787, z = 7}
local f15, t15 = {x = 1132, y = 2712, z = 7}, {x = 1193, y = 2767, z = 7}
local f16, t16 = {x = 1213, y = 2690, z = 7}, {x = 1355, y = 2800, z = 7}
local f17, t17 = {x = 1377, y = 2702, z = 7}, {x = 1522, y = 2797, z = 7}
local f18, t18 = {x = 1538, y = 2700, z = 7}, {x = 1680, y = 2801, z = 7}
function onThink(interval, lastExecution)
local first = getPlayersInArea(f1, t1)
local second = getPlayersInArea(f2, t2)
local third = getPlayersInArea(f3, t3)
local fourth = getPlayersInArea(f4, t4)
local fifth = getPlayersInArea(f5, t5)
local sixth = getPlayersInArea(f6, t6)
local seventh = getPlayersInArea(f7, t7)
local eighth = getPlayersInArea(f8, t8)
local ninth = getPlayersInArea(f9, t9)
local tenth = getPlayersInArea(f10, t10)
local eleventh = getPlayersInArea(f11, t11)
local twelfth = getPlayersInArea(f12, t12)
local thirteenth = getPlayersInArea(f13, t13)
local fourteenth = getPlayersInArea(f14, t14)
local fifteenth = getPlayersInArea(f15, t15)
local sixteenth = getPlayersInArea(f16, t16)
local seventeenth = getPlayersInArea(f17, t17)
local eighteenth = getPlayersInArea(f18, t18)
    
    if first then
        for _, pid in pairs(first) do
            if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822081))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822081))[1]) and tonumber(filtrateString(getGlobalStorageValue(822081))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 1 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if second then
        for _, pid in pairs(second) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822082))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822082))[1]) and tonumber(filtrateString(getGlobalStorageValue(822082))[2]) <= os.time()    then
            doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 2 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if third then
        for _, pid in pairs(third) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822083))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822083))[1]) and tonumber(filtrateString(getGlobalStorageValue(822083))[2]) <= os.time() then
                        doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 3 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if fourth then
        for _, pid in pairs(fourth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822084))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822084))[1]) and tonumber(filtrateString(getGlobalStorageValue(822084))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 4 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if fifth then
        for _, pid in pairs(fifth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822085))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822085))[1]) and tonumber(filtrateString(getGlobalStorageValue(822085))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 5 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if sixth then
        for _, pid in pairs(sixth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822086))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822086))[1]) and tonumber(filtrateString(getGlobalStorageValue(822086))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 6 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if seventh then
        for _, pid in pairs(seventh) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822087))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822087))[1]) and tonumber(filtrateString(getGlobalStorageValue(822087))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 7 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if eighth then
        for _, pid in pairs(eighth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822088))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822088))[1]) and tonumber(filtrateString(getGlobalStorageValue(822088))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 8 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if ninth then
        for _, pid in pairs(ninth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822089))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822089))[1]) and tonumber(filtrateString(getGlobalStorageValue(822089))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 9 expirou. Você foi levado até seu templo.")
            end
        end
    end
    if tenth then
        for _, pid in pairs(tenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822090))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822090))[1]) and tonumber(filtrateString(getGlobalStorageValue(822090))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 10 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if eleventh then
        for _, pid in pairs(eleventh) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822091))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822091))[1]) and tonumber(filtrateString(getGlobalStorageValue(822091))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 11 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if twelfth then
        for _, pid in pairs(twelfth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822092))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822092))[1]) and tonumber(filtrateString(getGlobalStorageValue(822092))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 12 expirou. Você foi levado até seu templo.")
            end
        end
    end
            if thirteenth then
        for _, pid in pairs(thirteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822093))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822093))[1]) and tonumber(filtrateString(getGlobalStorageValue(822093))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 13 expirou. Você foi levado até seu templo.")
            end
        end
    end
            if fourteenth then
        for _, pid in pairs(fourteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822094))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822094))[1]) and tonumber(filtrateString(getGlobalStorageValue(822094))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 14 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if fifteenth then
        for _, pid in pairs(fifteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822095))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822095))[1]) and tonumber(filtrateString(getGlobalStorageValue(822095))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 15 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if sixteenth then
        for _, pid in pairs(sixteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822096))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822096))[1]) and tonumber(filtrateString(getGlobalStorageValue(822096))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 16 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if seventeenth then
        for _, pid in pairs(seventeenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822097))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822097))[1]) and tonumber(filtrateString(getGlobalStorageValue(822097))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 17 expirou. Você foi levado até seu templo.")
            end
        end
    end
        if eighteenth then
        for _, pid in pairs(eighteenth) do
                if getPlayerAccountId(pid) ~= tonumber(filtrateString(getGlobalStorageValue(822098))[1]) or getPlayerAccountId(pid) == tonumber(filtrateString(getGlobalStorageValue(822098))[1]) and tonumber(filtrateString(getGlobalStorageValue(822098))[2]) <= os.time() then
                doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                doPlayerPopupFYI(pid, "Seu tempo como dono da Cave 18 expirou. Você foi levado até seu templo.")
            end
        end
    end

    return true
end

function getPlayersInArea(fromPos, toPos)
local players = {}
      for _, pid in ipairs(getPlayersOnline()) do
          if isInRange(getPlayerPosition(pid), fromPos, toPos) then
             table.insert(players, pid)
          end
      end
      return players
end

 

 

Muito obrigado ! Rep

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