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

teleport scroll for 0.3.6pl

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
Hello, i want a teleport scroll thats working 100%, and you cant use the scroll in fight, if you got a script there u must wait 10 sec for get teleported it can be okay to. thx
 
Actions.xml add
Code:
	<action itemid="[COLOR="red"]1775[/COLOR]" event="script" value="tpscroll1.lua"/>
Change red to itemid of your scroll.
tpscroll1.lua
Lua:
--Script by Sonical
local newpos = {x=32247, y=33569, z=7} --New position
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
      doSendMagicEffect(getPlayerPosition(cid), 2)
      doTeleportThing(cid,newpos)
      doSendMagicEffect(newpos,10)
	  doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid,25,"You could not use this teleport scroll if you are in fight!")
end
return 1
end
2. this one will tp him to his temple
Lua:
--Script by Sonical
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
      doSendMagicEffect(getPlayerPosition(cid), 2)
      doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
      doSendMagicEffect(newpos,10)
	  doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid,25,"You could not use this teleport scroll if you are in fight!")
end
return 1
end

Rep++
 
It is just another script "2. this one will tp him to his temple". First one will teleport him to position (which can be found in script).
 
oke i understand, but u gave him the wrong script right..
he asked for 10sec casttime..
Can't find that in the scripts.
 
Lua:
local newpos = {x=94, y=122, z=7} --New position
local buffer = 10  -- in seconds(time to wait to get tped)
local cooldown = 60  -- inseconds
local storage = 9075
--[[end of config]]-- 
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(getCreatureCondition(cid, CONDITION_INFIGHT) == true) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You may not use this while in fight.")
    return true
	end
	if not exhaustion.get(cid, storage) then
	   doCreatureSetNoMove(cid, 1)
	    exhaustion.set(cid, storage, cooldown)
	   countDown(buffer, getThingPos(cid), 5, "teleported!", 2)
	   addEvent(doTeleportThing,buffer * 1000,cid,newpos)
	    addEvent(doSendMagicEffect, buffer * 1000 +2 ,newpos, 10)
		addEvent(doCreatureSetNoMove,buffer * 1000,cid, 0)
	else
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Cooldown : "..exhaustion.get(cid, storage).." seconds.")
	end
return true
end
 
Back
Top