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

Teleport item.

Potar

SocialWorld
Senator
Joined
Mar 1, 2009
Messages
1,661
Reaction score
125
Location
Warsaw, Poland
Hello i looking for script like:

If you have item with x ID then you can tp to the !pos1 and !pos2 etc. only in PZ zones.

I give REP+
 
Explain more..

If the player has the item, do they use the item to teleport or do they stand on a square to teleport?
 
If you have an item ID and you are standing in a protective zone (PZ) you can teleport to the position of XYZ.
Random position not tample.

goto "thaisdp
goto "venoredp

etc.
 
It confuses me, first you say that you need an item like this, then you give a talkaction as example.
Anyway, I made this in a hurry, though it should work;

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
[COLOR="#008080"]-- Configuration --
local removeItem = true -- change to false if you don't want the item to be removed
local tpLocation = {x=[COLOR="#FF0000"]????[/COLOR],y=[COLOR="#FF0000"]????[/COLOR],z=[COLOR="#FF0000"]??[/COLOR]} -- The location where to teleport player
local textmsg = "You were successfully teleported."
-- End of configuration--[/COLOR]

doTeleportThing(cid, tpLocation, true)
doSendMagicEffect(tpLocation, CONST_ME_TELEPORT)
doPlayerSendCancel(cid, textmsg)
if removeItem == true then
doRemoveItem(item.uid, 1)
end
end
 
Okay, thx all for answers, i have this script form andypsylon.
There's if anyone need it.
LUA:
-- ver. 1 2011-11-30
-- author tfs, otland.net/members/andypsylon

local c = {
["bla1"] = {x = 651, y = 659, z = 7},
["bla2"] = {x = 659, y = 651, z = 7},
["bla3"] = {x = 655, y = 655, z = 7},
["bla4"] = {x = 654, y = 654, z = 7}
}
local itemek = 8266

function onSay(cid, words, param, channel)
if(not getTileInfo(getThingPosition(cid)).protection) then
 return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action (no pz).") and true
end
local pos = {x = 0, y = 0, z = 0}
if(param ~= '') then
 pos = c[param:lower()]
else
 return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") and true
end
if getPlayerItemCount(cid, itemek) < 1 then
 return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action (no item).") and true
end

if(not pos or isInArray({pos.x, pos.y}, 0)) then
 return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.") and true
end

pos = getClosestFreeTile(cid, pos, true)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
 return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.") and true
end

local tmp = getThingPosition(cid)
if(doTeleportThing(cid, pos, true) and not isPlayerGhost(cid)) then
 doSendMagicEffect(tmp, CONST_ME_POFF)
 doSendMagicEffect(pos, CONST_ME_TELEPORT)
end

return true
end
 
Back
Top