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

Solved Teleport Rune Wont Work.

Powtreeman

Member
Joined
Sep 26, 2011
Messages
400
Reaction score
6
Location
USA
Hi im trying to create a teleport rune based off of this thread http://otland.net/f132/teleport-rune-spell-170947/index2.html

It just does not work at all. I tried putting the same script in spells and putting the line

<rune group="support" spellid="14" name="Teleport" id="2309" allowfaruse="1" charges="0" lvl="2" maglv="4" cooldown="2000" groupcooldown="2000" aggressive="0" blocktype="solid" script="teleport"/>

under spells. But it does not work and brings up the error

[16/03/2013 01:39:53] Warning: [Event::checkScript] Can not load script. /scripts/teleport
[16/03/2013 01:39:53] cannot open data/spells/scripts/teleport: No such file or directory

But when I change the file from script="teleport"/> to
script="support/teleport"/> which is where I put the script. It just shows the error

<rune group="support" spellid="14" name="Teleport" id="2309" allowfaruse="1" charges="0" lvl="2" maglv="4" cooldown="2000" groupcooldown="2000" aggressive="0" blocktype="solid" script="support/teleport"/>


What am I doing wrong?
 
You forgot .lua at the end!
XML:
<rune group="support" spellid="14" name="Teleport" id="2309" allowfaruse="1" charges="0" lvl="2" maglv="4" cooldown="2000" groupcooldown="2000" aggressive="0" blocktype="solid" script="support/teleport.lua"/>
 
Thanks a ton! but it shows a new error

[16/03/2013 15:29:24] Warning: [Event::checkScript] Event onCastSpell not found. /scripts/teleport.lua
 
Alright im a bit confused. What do I put in actions and what do I put in spells?
the script is this.

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 by a moderator:
alright so i put that in actions and the one from Cyko in spells.xml

The spells.xml one is the one that brings up an error. But in actions nothing happens.
 
Put the script in actions/scripts and name it (teleport.lua)

Actions/actions.xml paste Ninja's line
 
Got errors? or if you use Mystic Spirit
XML:
<action itemid="2309" allowfaruse="1" script="other/teleport.lua"/>

Be sure you add the script in the right folder.
 
I put it in the right folder and everything. No errors at all. It feels like this actions folder doesn't do anything when I change something in it.
But yes I do use mystic spirit

And I really do appreciate the help everyone.
 
The errors you posted on the first post suggest that you did not properly implement the script, or did not assign the correct directory for the script. If the errors persist, double check the location of the script and make sure the actions.xml is properly assigned (e.g. teleport.lua). You will also have to restart the server for changes to take effect.

See Limos post above.
 
I've assigned the script to the right spot. I've even put the teleport script in every folder of the actions folder. I've changed it from script to function to see if an error would come up. No errors on the console show at all. But it still doesn't work.

Would anybody be willing to do teamviewer or something?
 
Alright. I put this in actions XML

<action itemid="2309" allowfaruse="1" event="script" value="other/teleportrune.lua"/>

note that i changed it to avoid it looking like the other teleport script that is for the GM commands /up /up /a 2 etc.

Then I put the teleportrune.lua script in actions/scripts/other

and yes the item ID is the purple rune I want the teleport rune to work on. I renamed it teleport rune under items.xml
 
Back
Top