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