• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Script Teleport/ Effect Erro (OTX-8.60)

Gaber Zen

Well-Known Member
Joined
Apr 22, 2023
Messages
224
Reaction score
51
Location
Egypt
Hello Guys
I have a problem in my Script Teleport Effect does not work?
How i can fix it. After Close Get bordcast, With the adjustment of every minute broadcast the castle is online
Like That photo
Lua:
function onTime(interval)
    local config = {
    pos = {x=1675, y=1483, z=5}, -- Posiçمo aonde sera criado o teleport
    topos = {x=1675, y=1480, z=4}, -- Posiçمo pra onde o teleport ira levar o player
    tpid = 1387, -- id do teleport
    time = 60 -- tempo que o teleport ira sumir em minutos
    }
  

    function DelTp()
    local t = getTileItemById(config.pos, config.tpid)
    if t then
    doRemoveItem(t.uid, 1)
    doSendMagicEffect(config.pos, CONST_ME_POFF)
    end
    end

function countPos(pos,tempo)
if tempo > 0 then
doSendAnimatedText(pos,tempo,TEXTCOLOR_YELLOW)
addEvent(countPos,1000,pos,tempo-1)
else
doSendMagicEffect(pos,2)
end
end
    doItemSetAttribute(doCreateTeleport(1387, config.topos, config.pos), "aid", 1749)
    doBroadcastMessage("Event Castle24  open 60 minutos")
    setGlobalStorageValue(16505, 1)
    addEvent(DelTp, config.time*60*1000)
    addEvent(setGlobalStorageValue, config.time*60*1000, 16505, -1)
    countPos(var.pos,20)
      return true
    end
tim.png
 
Last edited:
Solution
Lua:
local config = {
    pos = {x=1675, y=1483, z=5},
    topos = {x=1675, y=1480, z=4},
    tpid = 1387,
    time = 60
}

function DelTp()
    local t = getTileItemById(config.pos, config.tpid)
    if t then
        doRemoveItem(t.uid, 1)
        doSendMagicEffect(config.pos, CONST_ME_POFF)
    end
end

function countPos(pos, tempo)
    if tempo > 0 then
        doSendAnimatedText(pos, tempo, TEXTCOLOR_YELLOW)
        addEvent(countPos, 1000, pos, tempo - 1)
    else
        doSendMagicEffect(pos, 2)
    end
end

function onTime(interval)
    doItemSetAttribute(doCreateTeleport(config.tpid, config.topos, config.pos), "aid", 1749)
    doBroadcastMessage("Event Castle24 open for 60 minutes")
    setGlobalStorageValue(16505, 1)...
Lua:
local config = {
    pos = {x=1675, y=1483, z=5},
    topos = {x=1675, y=1480, z=4},
    tpid = 1387,
    time = 60
}

function DelTp()
    local t = getTileItemById(config.pos, config.tpid)
    if t then
        doRemoveItem(t.uid, 1)
        doSendMagicEffect(config.pos, CONST_ME_POFF)
    end
end

function countPos(pos, tempo)
    if tempo > 0 then
        doSendAnimatedText(pos, tempo, TEXTCOLOR_YELLOW)
        addEvent(countPos, 1000, pos, tempo - 1)
    else
        doSendMagicEffect(pos, 2)
    end
end

function onTime(interval)
    doItemSetAttribute(doCreateTeleport(config.tpid, config.topos, config.pos), "aid", 1749)
    doBroadcastMessage("Event Castle24 open for 60 minutes")
    setGlobalStorageValue(16505, 1)
    addEvent(DelTp, config.time * 60 * 1000)
    addEvent(setGlobalStorageValue, config.time * 60 * 1000, 16505, -1)
    addEvent(countPos, 0, config.pos, 20) -- Iniciar a contagem de posição imediatamente
    return true
end

What map is this? It's very beautiful, congratulations!
 
Solution
Back
Top