• 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!

temple teleport

Kjhgfd

New Member
Joined
Dec 25, 2016
Messages
63
Reaction score
1
hello guys i use 0.4 i need help to edit in this script
when player move or somone push him tp stop count and stop teleport

Code:
function countDown(number, pos, effect, msgonend, effectonend)
  local n = number
       for i = 1, number do
           addEvent(doSendAnimatedText,i* 1000, pos, n > 1 and n.."" or msgonend .."", n < 6 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
           addEvent(doSendMagicEffect,i* 1000, pos, n > 1 and effect or effectonend )
              n = n -1
       end
      n = number
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayerPzLocked(cid) then
    doPlayerSendCancel(cid,"You Cannot Teleport Right After A Battle!.")
else
    countDown(10, getThingPos(cid), 5, "Warped!", 2)
    doCreatureSetNoMove(cid, 1)
    addEvent(doTeleportThing,10000,cid,getTownTemplePosition(getPlayerTown(cid)),FALSE)
    addEvent(doCreatureSetNoMove,10000,cid, 0)
    addEvent(doSendMagicEffect,10004,getTownTemplePosition(getPlayerTown(cid)), 10)
  end
return true
end
 
hello guys i use 0.4 i need help to edit in this script
when player move or somone push him tp stop count and stop teleport

Code:
function countDown(number, pos, effect, msgonend, effectonend)
  local n = number
       for i = 1, number do
           addEvent(doSendAnimatedText,i* 1000, pos, n > 1 and n.."" or msgonend .."", n < 6 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
           addEvent(doSendMagicEffect,i* 1000, pos, n > 1 and effect or effectonend )
              n = n -1
       end
      n = number
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayerPzLocked(cid) then
    doPlayerSendCancel(cid,"You Cannot Teleport Right After A Battle!.")
else
    countDown(10, getThingPos(cid), 5, "Warped!", 2)
    doCreatureSetNoMove(cid, 1)
    addEvent(doTeleportThing,10000,cid,getTownTemplePosition(getPlayerTown(cid)),FALSE)
    addEvent(doCreatureSetNoMove,10000,cid, 0)
    addEvent(doSendMagicEffect,10004,getTownTemplePosition(getPlayerTown(cid)), 10)
  end
return true
end
Lua:
function initCountDown(cid, pos, seconds)
    if not isPlayer(cid) then
        return
    end

    local currentPos = getThingPos(cid)
    if currentPos.x ~= pos.x or currentPos.y ~= pos.y or currentPos.z ~= pos.z then
        doPlayerSendCancel(cid, "You Cannot Teleport While Moving.")
        doCreatureSetNoMove(cid, 0)
        return
    end

    if seconds ~= 0 then
        doSendAnimatedText(pos, seconds, TEXTCOLOR_RED)
        doSendMagicEffect(pos, 3)
        addEvent(initCountDown, 1000, cid, pos, seconds - 1)
    else
        doSendAnimatedText(pos, "Warped!", TEXTCOLOR_GREEN)
        doSendMagicEffect(pos, 2)
        local templePosition = getTownTemplePosition(getPlayerTown(cid))
        doTeleportThing(cid, templePosition, FALSE)
        doCreatureSetNoMove(cid, 0)
        doSendMagicEffect(templePosition, 10)
    end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isPlayerPzLocked(cid) then
        doPlayerSendCancel(cid, "You Cannot Teleport Right After A Battle!.")
    else
        initCountDown(cid, getThingPos(cid), 10)
        doCreatureSetNoMove(cid, 1)
    end
    return true
end
 
Lua:
function initCountDown(cid, pos, seconds)
    if not isPlayer(cid) then
        return
    end

    local currentPos = getThingPos(cid)
    if currentPos.x ~= pos.x or currentPos.y ~= pos.y or currentPos.z ~= pos.z then
        doPlayerSendCancel(cid, "You Cannot Teleport While Moving.")
        doCreatureSetNoMove(cid, 0)
        return
    end

    if seconds ~= 0 then
        doSendAnimatedText(pos, seconds, TEXTCOLOR_RED)
        doSendMagicEffect(pos, 3)
    else
        doSendAnimatedText(pos, "Warped!", TEXTCOLOR_GREEN)
        doSendMagicEffect(pos, 2)
        local templePosition = getTownTemplePosition(getPlayerTown(cid))
        doTeleportThing(cid, templePosition, FALSE)
        doCreatureSetNoMove(cid, 0)
        doSendMagicEffect(templePosition, 10)
    end

    addEvent(initCountDown, 1000, cid, pos, seconds - 1)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isPlayerPzLocked(cid) then
        doPlayerSendCancel(cid, "You Cannot Teleport Right After A Battle!.")
    else
        initCountDown(cid, getThingPos(cid), 10)
        doCreatureSetNoMove(cid, 1)
    end
    return true
end
very good, could you fix the following problem?
1 - if the player is moved or teleported he is locked... he needs to go back to normal after the action finished (because teleported or cancelled per move)

2 - if the player uses it in the teleport location, the counter counts negatively
 
Last edited:
very good, could you fix the following problem?
1 - if the player is moved or teleported he is locked... he needs to go back to normal after the action finished (because teleported or cancelled per move)

2 - if the player uses it in the teleport location, the counter counts negatively
Thanks for reporting, it's fixed.
 
I'm waiting, can you fix it? I made a change to the checking part of pz


if hasCondition(cid, CONDITION_INFIGHT) == false then
end
 
Hello :D :D

1 - u can use scroll with pz
2 - you can use many times or scroll at the same time
3 - very important = when it is played to the temple the char is stuck in that stack without being able to move
4 - if you move the person who is about to be teleported it crashes the same as when it is teleported

 
Back
Top