local config = {
itemN = "spike sword",-- Name of the item - NOT ID! [Name MUST be exact!]
tpPlace = {x = 100, y = 100, z = 7}--Place to teleport to!
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local itemId = getItemIdByName(itemN)
if(getPlayerItemCount(cid, itemId) => 1) then
doTeleportThing(cid, config.tpPlace)
doPlayerRemoveItem(cid, itemId, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been teleported and 1x " .. config.itemN .. " has been removed from your inventory.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need a " .. config.itemN .. " to be teleported!")
end
return true
end