• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Teleport scroll

Etzi

New Member
Joined
May 19, 2014
Messages
28
Reaction score
1
TFS 0.3.6 8.60 Hello i want teleport scroll when used it will be removed and you will be teleported to temple with 10 seconds countdown thanks :)
 
For countdown.
https://otland.net/threads/new-dp-teleport.224924/#post-2164107
For remove item without going back.
Code:
local function doTeleportPlayer(cid)
     if isPlayer(cid) then
         doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported to the temple.")
     end
end

local function doSendEffect(cid, c)
     doSendAnimatedText(getCreaturePosition(cid), 10-c, math.random(200))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)

     if getCreatureCondition(cid, CONDITION_INFIGHT) then
         doPlayerSendCancel(cid, "You can't use this when you're in a fight.")
         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
         return true
     end
     doRemoveItem(item.uid, 1)
     addEvent(doTeleportPlayer, 10 * 1000, cid)
     for c = 0, 9 do
         addEvent(doSendEffect, c * 1000, cid, c)
     end
     return true
end
 
Back
Top