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

I need a teleport script

Sheriff

New Member
Joined
Mar 13, 2009
Messages
68
Reaction score
0
Location
Spain
I need a script when you make a quest then you can use a teleport.
Thanks.

Edit: And is possible tp when wear or have X outfit you can use tp?
 
Last edited:
Can you try this one for me?
Lua:
function onStepIn(cid, item, position, fromPosition)
local toPositionz = {x=x, y=y, z=z}

	if item.actionid == 15318 then
              if getPlayerItemCount(cid, 2341) >= 1 and getPlayerStorageValue(cid, 5031) == -1 then
                 doTeleportThing(cid, toPositionz)
                 setPlayerStorageValue(cid, 5031, 1)
              else
                 doTeleportThing(cid, fromPosition)
              end
             end
end
 
Code:
local config = {
	destination = {x = 100, y = 100, z = 7},
	storage = 12345
}

function onStepIn(cid, item, position, fromPosition)
	local v = getPlayerStorageValue(cid, config.storage) > 0 and config.destination or fromPosition
	return doTeleportThing(cid, v) and doSendMagicEffect(v, CONST_ME_TELEPORT)
end
 
Im getting this error when i try to put actionid in teleport.
f4ig4o.png

Using OTmapeditor.
 
Okey, What I understood was that you if you click chest > You get x item, and being teleported somewhere.

Here is the script:

PHP:
function onUse(cid, item, frompos, item2, topos)
local newposition = {x=, y=, z=}

        if item.uid == 11111 then
        queststatus = getPlayerStorageValue(cid,1111)
        if queststatus == -1 then
        doPlayerSendTextMessage(cid,22,"Congratulations, You have found 100 Cystal Coins and being teleported somewhere!")
        doPlayerAddItem(cid,2160,100)
		doTeleportThing(cid, newposition)
		doSendMagicEffect(newposition, 10)
        setPlayerStorageValue(cid,11111,1)
        else
        doPlayerSendTextMessage(cid,22,"It's empty!")
        end
        else
        return 0
        end

        return 1
        end

Cyko, make it shorter :peace:<_<
 
Not Tested, Maybe Works?

Edit: And is possible tp when wear or have X outfit you can use tp?

Code:
function onStepIn(cid, item, position, fromPosition)
	local outfit = {lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}
	if getCreatureOutfit(cid) == outfit then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome.")
	else
		doTeleportThing(cid, fromPosition, true)
		doPlayerSendCancel(cid, "You must be wearing lookType " .. outfit.lookType .. ".")
	end
	return true
end
 
Code:
function onStepIn(cid, item, position, fromPosition)
    local outfit = {lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}
    if getCreatureOutfit(cid) == outfit then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome.")
    else
        doTeleportThing(cid, fromPosition, true)
        doPlayerSendCancel(cid, "You must be wearing lookType " .. outfit.lookType .. ".")
    end
    return true
end

error, you cant compare tables 8)

Lua:
function compareOutfits(o1, o2)
    return (o1.lookType == o2.lookType and o1.lookHead == o2.lookHead and o1.lookAddons == o2.lookAddons and o1.lookLegs == o2.lookLegs and o1.lookBody == o2.lookBody and o1.lookFeet == o2.lookFeet)
end

function onStepIn(cid, item, position, fromPosition)
    local outfit = {lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}
    if compareOutfits(getCreatureOutfit(cid), outfit) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome.")
    else
        doTeleportThing(cid, fromPosition, true)
        doPlayerSendCancel(cid, "You must be wearing lookType " .. outfit.lookType .. ".")
    end
    return true
end
 
Last edited:
error, you cant compare tables 8)

Lua:
function compareOutfits(o1, o2)
    return (o1.lookType == o2.lookType and o1.lookHead == o2.lookHead and o1.lookAddons == o2.lookAddons and o1.lookLegs == o2.lookLegs and o1.lookBody == o2.lookBody and o1.lookFeet == o2.lookFeet)
end

function onStepIn(cid, item, position, fromPosition)
    local outfit = {lookType = 266, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}
    if compareOutfits(getCreatureOutfit(cid), outfit) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome.")
    else
        doTeleportThing(cid, fromPosition, true)
        doPlayerSendCancel(cid, "You must be wearing lookType " .. outfit.lookType .. ".")
    end
    return true
end

Maybe, but

Code:
if compareOutfits(getCreatureOutfit(cid), outfit) then

=

Code:
if compareOutfits(getCreatureOutfit(cid, outfit)) then
 
Maybe, but

Code:
if compareOutfits(getCreatureOutfit(cid), outfit) then
=

Code:
if compareOutfits(getCreatureOutfit(cid, outfit)) then

:/ you really need learn a lot 8) nothing else to say, best check what you just said.
 
Back
Top