• 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 rune/spell

Werewolf

Forbidden Ascension
Joined
Jul 15, 2012
Messages
886
Reaction score
123
XD i have this idea but have no idea how to make it, Basicly...

Use rune,
Then click somewhere on your screen with the cross-hairs
And the rune will teleport your character To that square,
If possible it needs to have a 3 second cool down time.
And it cannot teleport threw walls.

Rune Id # 2296
Cid # 3183

I would be very grateful if someone can make this for me If it is possible to make..
Tyvm.

(Also if possible if you can make this a spell instead of a rune that would be better, but i doubt its possible)

(Client Version 8.54) Running a (Forgotten server base)
 
data/actions/scripts/script.lua

Code:
local t = {
	storage = 12345,
	time = 3
}

function onUse(cid, item, fromPosition, toPosition)
	if(hasCondition(cid, CONDITION_INFIGHT) [COLOR="#FF0000"]or isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid))[/COLOR]) then
		doPlayerSendCancel(cid, "Sorry, not possible.")
	elseif(getPlayerStorageValue(cid, t.storage) > os.time()) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, t.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, t.storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
	else
		doTeleportThing(cid, toPosition)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
		setPlayerStorageValue(cid, t.storage, os.time() + t.time)
	end
	return true
end
Edit: 8.54 might not have "getTileThingByPos", so you may have to remove what is highlighted in Red.
 
Last edited:
Thanks Alot :D! THis means alot to me thank you <3

- - - Updated - - -

Well i Tried the rune Out and sadly i don't think it works... You Use the rune and click the square you want to teleport too... but the character doesn't teleport there... he just walks to that spot then the rune disappears....

K Basically what im looking for is a Rune That
---teleports you Exactly to the square you shoot at
---I want the Shoot type to look like an energy shot.
---The teleporting animation of the portal blue, when your character teleports to that square.
--- It must be able to be used in battle.
--- It cannot teleport you through walls.

The purpose of this rune is to Teleport the character to any place on the screen the user chooses. To get away from the opponent or to teleport past them if they ever get trapped in a small ally way.


Thats what the rune is for. i would be very grateful if someone could kindly make a rune that does this <3 Please an thankies.

- - - Updated - - -

Well J.Dre I tried it again with the doTeleportThing(cid, toPosition, false) Like you changed However it did the exact same thing.... Just walks to the position. Also i have to delete the red part for the script to do anything... Maybe that's why it doesn't work?
 
LUA:
local t = {
	storage = 12345,
	time = 3
}

function onUse(cid, item, fromPosition, toPosition)
	if(isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid)) then
		doPlayerSendCancel(cid, "You cannot teleport here.")
	elseif(getPlayerStorageValue(cid, t.storage) > os.time()) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, t.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, t.storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
	else
		doTeleportThing(cid, toPosition, false)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
		setPlayerStorageValue(cid, t.storage, os.time() + t.time)
	end
	return true
end

Maybe that works like you want?
 
P.S. The script above should work, even after editing code in the sources to solve this "walking" problem. :thumbup:

Walking problem can be solved by writing like this in actions.xml.

Code:
<action itemid="XXXX" event="script" value="NAME.lua" [COLOR=#ff0000]allowfaruse="1"[/COLOR]/>

Script above didn't load at first because it missed one bracket. :p

Code:
if (isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid))[COLOR=#ff0000])[/COLOR] then
 
Script above didn't load at first because it missed one bracket. :p

Code:
if (isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid))[COLOR=#ff0000])[/COLOR] then

He didn't have allowfaruse="1"... wow.

I should avoid copying old code then, ha ha. Glad it's solved now. :p
 
o.o I Dunno its still not working, When it had the 2 )) at the end the rune says You cannot use htis object, then i added that Third ) and now the rune does nothing and says nothing :(

The rune has the 3 Second timer on it but it doesn't Teleport me at all...

Is there something im doing wrong?
 
Last edited:
I tested it yesterday, worked fine.

XML:
<action itemid="XXXX" event="script" value="insertnamehere.lua" allowfaruse="1"/>

LUA:
local t = {
    storage = 12345,
    time = 3
}


function onUse(cid,item,fromPosition,itemEx,toPosition)
    if (isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid))) then
        doPlayerSendCancel(cid, "You cannot teleport here.")
    elseif(getPlayerStorageValue(cid, t.storage) > os.time()) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, t.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, t.storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
    else
        doTeleportThing(cid, toPosition, false)
        doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
        setPlayerStorageValue(cid, t.storage, os.time() + t.time)
    end
    return true
end
 
What Version are you using?


There we go :D. after i used yours it started working :D AWESOME thanks alot.


Altho if its not too much trouble is it possible to make the rune Shoot the Energy shot to the place your aiming at, to give it effects like you teleporting? kind of thing? XD ofc its up to you guys im happy atm :D
Thank you all again for the help!

OH also.. can you make it so its only used by Vocations

playerVoc == 8
playerVoc == 16
playerVoc == 46
playerVoc == 47
playerVoc == 48

XD i have 58 vocations in my server but i need these 5 to use the rune please :D
 
Last edited:
Altho if its not too much trouble is it possible to make the rune Shoot the Energy shot to the place your aiming at, to give it effects like you teleporting? kind of thing? XD ofc its up to you guys im happy atm :D
Thank you all again for the help!

LUA:
local t = {
	storage = 12345,
	time = 3
}

function onUse(cid, item, fromPosition, toPosition)
	if(isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid))) then
		doPlayerSendCancel(cid, "Sorry, not possible.")
	elseif(getPlayerStorageValue(cid, t.storage) > os.time()) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, t.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, t.storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
	else
		doSendDistanceShoot(getCreaturePosition(cid), toPosition, CONST_ANI_HOLY) -- Holy effect can be changed here.
		doTeleportThing(cid, toPosition, false)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
		setPlayerStorageValue(cid, t.storage, os.time() + t.time)
	end
	return true
end
 
OH also.. can you make it so its only used by Vocations

playerVoc == 8
playerVoc == 16
playerVoc == 46
playerVoc == 47
playerVoc == 48

XD i have 58 vocations in my server but i need these 5 to use the rune please :D

Try this one. :p

LUA:
local t = {
    storage = 12345,
    time = 3,
    vocations = {8, 16, 46, 47, 48}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(t.vocations and not isInArray(t.vocations, getPlayerVocation(cid) or isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid)))) then
        doPlayerSendCancel(cid, "Sorry, not possible.")
    elseif(getPlayerStorageValue(cid, t.storage) > os.time()) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, t.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, t.storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
    else
        doSendDistanceShoot(getCreaturePosition(cid), toPosition, CONST_ANI_HOLY) -- Holy effect can be changed here.
        doTeleportThing(cid, toPosition)
        doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
        setPlayerStorageValue(cid, t.storage, os.time() + t.time)
    end
    return true
end
 
Last edited:
Oh god.. Sorry to bother you guys again but.... HUGE Problem.. the TP rune allowed people to teleport in other people homes, steal there items.. they can also tp on the depo and steal some more.... Everyone is really upset... think you can make it so the rune cannot be used IN PZ zones, IN or Out of them? Please....


All i got to help is this script... But i dont know were to put it XD

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getTilePzInfo(getCreaturePosition(cid)) == TRUE or getTilePzInfo(toPosition) == TRUE then
warnPlayer(cid, "You cannot use this weapon in a protection zone.")
else
 
Last edited:
LUA:
local t = {
    storage = 12345,
    time = 3,
    vocations = {8, 16, 46, 47, 48}
}


function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(t.vocations and not isInArray(t.vocations, getPlayerVocation(cid) or isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid)))) then
        doPlayerSendCancel(cid, "Sorry, not possible.")
    elseif getTileInfo(toPosition).house then
        doPlayerSendCancel(cid, "You cannot teleport to a house.")
    elseif getTileInfo(toPosition).protection then
        doPlayerSendCancel(cid, "You cannot use this weapon in a protection zone.")
    elseif(getPlayerStorageValue(cid, t.storage) > os.time()) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, t.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, t.storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
    else
        doSendDistanceShoot(getCreaturePosition(cid), toPosition, CONST_ANI_HOLY) -- Holy effect can be changed here.
        doTeleportThing(cid, toPosition)
        doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
        setPlayerStorageValue(cid, t.storage, os.time() + t.time)
    end
    return true
end
 
Last edited:
LUA:
local t = {
    storage = 12345,
    time = 3,
    vocations = {8, 16, 46, 47, 48}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(t.vocations and not isInArray(t.vocations, getPlayerVocation(cid) or isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid)))) then
        doPlayerSendCancel(cid, "Sorry, not possible.")
    elseif(getPlayerStorageValue(cid, t.storage) > os.time()) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, t.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, t.storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
	elseif getTileInfo(toPosition).depot or getTileInfo(toPosition).protection then
		doPlayerSendCancel(cid, "You cannot teleport to depot or house tile.")
    else
        doSendDistanceShoot(getCreaturePosition(cid), toPosition, CONST_ANI_HOLY) -- Holy effect can be changed here.
        doTeleportThing(cid, toPosition)
        doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
        setPlayerStorageValue(cid, t.storage, os.time() + t.time)
    end
    return true
end

Try it...

@up: depot tile maybe isnt a protection tile... xd
 
Back
Top