• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Temple Teleport Scroll [Release]

Alyhide

Banned User
Joined
Aug 21, 2010
Messages
1,945
Reaction score
54
Location
Switzerland
Here is a simple script made by Doggynub, but it's pretty useful. The temple teleport scroll.

Actions Folder : TempleTeleportScroll.LUA
Lua:
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



Actions.XML :
Lua:
<action itemid="8189" event="script" value="other/templeteleportscroll.lua"/>
 
Last edited:
You could've optimized the script and shortened it lots more.

Anyway, there have been hundreds of tp scroll scripts released already.

Here's mine..
Lua:
function onUse(cid, item, frompos, item2, topos)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(ppos,66)
doSendAnimatedText(frompos,'Wiee!',16)
else
doPlayerSendCancel(cid,"You can't teleport immediately after fight.")
doSendMagicEffect(ppos,2)
end
return 1
end
 
What is this??
TEXTCOLOR_RED or TEXTCOLOR_GREEN

TEXTCOLOR_RED never is nil or false. Then, only color red it is display.

--
Ok sorry I was not saw " n < 6" .
^_^
 
Humm , no credits :p , Btw "Teleported succesfully" wont appear all , as doSendAnimatedText() only show 8 characters.
 
You could've optimized the script and shortened it lots more.

Anyway, there have been hundreds of tp scroll scripts released already.

Here's mine..
Lua:
function onUse(cid, item, frompos, item2, topos)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(ppos,66)
doSendAnimatedText(frompos,'Wiee!',16)
else
doPlayerSendCancel(cid,"You can't teleport immediately after fight.")
doSendMagicEffect(ppos,2)
end
return 1
end


Ok thanks, I'll be sure to shorten it next time :)

Humm , no credits :p , Btw "Teleported succesfully" wont appear all , as doSendAnimatedText() only show 8 characters.


Ok, I will change that to "Warped!" xD
 
Back
Top