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

Teleporting Book

noshirtstan

New Member
Joined
Aug 2, 2020
Messages
68
Reaction score
2
Hey folks, I'm trying to make an item that on use will allow a player to teleport to a set location. I'm having a issue with the scripting though. I think i got the scripting done correctly, but when I go to use it, it says I cannot use the item. Also, I can't seem to figure out how to add a cooldown to do the item as well.

Here is what I have so far.

This is the .lua in scripts.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
tepos = {x=278, y=2039, z=15}

if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerSendCancel(cid, "Lose your battle sign first.")
else
doTeleportThing(cid, tpos)
doSendMagicEffect(tpos, 10)
end
end

This is what i have in the actions.xml

<action itemid="1955" script="custom/teleport.lua"/>

Any help would be greatly appreciated.

Thanks in advance!
 
Wrong section, You should post it Here
About the script you need to change line 7 and 8 tpos to tepos
 
Solution
Back
Top