• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Talkaction Request] Create Teleport, To Destination

justin234

New Member
Joined
Jan 22, 2008
Messages
999
Reaction score
4
Hello, I am looking for a working script for this.

!teleport "temple

Creates a teleport in front of you, for 10 seconds, to the destination.

Including:
Mana
Soul
Time Between Creation
and Level Requirments.

Kind Regards.

(Working on TFS 0.2 and TFS 0.3)
 
Last edited:
I think this work...

Code:
[COLOR="Blue"]function onSay(cid, words, param)

local config = {
	timeToRemove = [COLOR="DarkGreen"]60[/COLOR], --in seconds
	manaReq = [COLOR="DarkGreen"]500[/COLOR],
	soulReq = [COLOR="DarkGreen"]10[/COLOR],
	levelReq = [COLOR="DarkGreen"]70[/COLOR],
	playerPos = getCreaturePosition(cid),
	toPos = { x = [COLOR="DarkGreen"]588[/COLOR], y = [COLOR="DarkGreen"]1086[/COLOR], z = [COLOR="DarkGreen"]7[/COLOR], stackpos = [COLOR="DarkGreen"]1[/COLOR] },
	inPos = { x = [COLOR="DarkGreen"]playerPos.x+1[/COLOR], y = [COLOR="DarkGreen"]playerPos.y[/COLOR], z = [COLOR="DarkGreen"]playerPos.z[/COLOR], stackpos = [COLOR="DarkGreen"]playerPos.stackpos[/COLOR] }
}

[COLOR="DarkGreen"]if[/COLOR] getPlayerLevel(cid) [COLOR="DarkGreen"]>=[/COLOR] config.levelReq [COLOR="DarkGreen"]then[/COLOR]
	[COLOR="DarkGreen"]if[/COLOR] getCreatureMana(cid) [COLOR="DarkGreen"]>=[/COLOR] config.manaReq [COLOR="DarkGreen"]then[/COLOR]
		[COLOR="DarkGreen"]if[/COLOR] getPlayerSoul(cid) [COLOR="DarkGreen"]>=[/COLOR] config.soulReq [COLOR="DarkGreen"]then[/COLOR]

	doCreateTeleport([COLOR="DarkGreen"]1387[/COLOR], [COLOR="DarkGreen"]config.toPos[/COLOR], [COLOR="DarkGreen"]config.inPos[/COLOR])
	doSendMagicEffect([COLOR="DarkGreen"]config.inPos[/COLOR], [COLOR="DarkGreen"]CONST_ME_TELEPORT[/COLOR])
	addEvent([COLOR="DarkGreen"]doRemoveTeleport[/COLOR], (1000*config.timeToRemove))

		else

	doPlayerSendTextMessage(cid,22,"[COLOR="DarkGreen"]You need level " .. config.levelReq .. " to create a teleport.[/COLOR]")

			end
				else
	
	doPlayerSendTextMessage(cid,22,"[COLOR="DarkGreen"]You need " .. config.manaReq .. " mana points to create a teleport.[/COLOR]")

			end
		else
	
	doPlayerSendTextMessage(cid,22,"[COLOR="DarkGreen"]You need " .. config.soulReq .. " soul points to create a teleport.[/COLOR]")

	end
end

[COLOR="DarkGreen"]function[/COLOR] doRemoveTeleport()

local playerPos = getCreaturePosition(cid)
local inPos = { x = [COLOR="DarkGreen"]playerPos.x+1[/COLOR], y = [COLOR="DarkGreen"]playerPos.y[/COLOR], z = [COLOR="DarkGreen"]playerPos.z[/COLOR], stackpos = [COLOR="DarkGreen"]playerPos.stackpos[/COLOR] }

	[COLOR="DarkGreen"]if[/COLOR] getThingfromPos([COLOR="DarkGreen"]inPos[/COLOR]).itemid [COLOR="DarkGreen"]==[/COLOR] [COLOR="DarkGreen"]1387[/COLOR] [COLOR="DarkGreen"]then[/COLOR]
	doRemoveItem(getThingfromPos([COLOR="DarkGreen"]inPos[/COLOR]).uid,[COLOR="DarkGreen"]1[/COLOR])
	doSendMagicEffect([COLOR="DarkGreen"]inPos[/COLOR], [COLOR="DarkGreen"]CONST_ME_POFF[/COLOR])

	return [COLOR="DarkGreen"]TRUE[/COLOR]

	end
end [/COLOR]
 
Yes but,
can it be like this?

PHP:
function onSay(cid, words, param)
[depot] { x = 588, y = 1086, z = 7, stackpos = 1 },
[temple] { x = 588, y = 1086, z = 7, stackpos = 1 },
[town] { x = 588, y = 1086, z = 7, stackpos = 1 }

Different places, in the same script.
 
@up
Why creating a teleport?
just make like !teleport "temple he teleports to temple.
Also if he dont got PZ, I'll make one and see ;)

Fast made, test my idea;)

Not Tested.
PHP:
function onSay(cid, words, param)

local textback = "You have been teleport to your temple"
local textinfight = "You can not be teleported to your temple when you are in a fight"

if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
doTeleportThing(getPlayerTown(cid))
doPlayerSendTextMessage(cid, 22, textback)
else
doPlayerSendTextMessage(cid, 22, textinfight)
end
return TRUE
end
 
Last edited:
@up
Why creating a teleport?
just make like !teleport "temple he teleports to temple.
Also if he dont got PZ, I'll make one and see ;)

Fast made, test my idea;)

Not Tested.
PHP:
function onSay(cid, words, param)

local textback = "You have been teleport to your temple"
local textinfight = "You can not be teleported to your temple when you are in a fight"

if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
doTeleportThing(getPlayerTown(cid))
doPlayerSendTextMessage(cid, 22, textback)
else
doPlayerSendTextMessage(cid, 22, textinfight)
end
return TRUE
end

Because then, only 1 person can use it. With a teleporter multiple persons can go trough.
 
Because then, only 1 person can use it. With a teleporter multiple persons can go trough.

Exactly my point.

So if a group of people get stuck on a quest,
maybe only the sorcerer has enough soul/mana to make a teleport.

Then they all have 10 seconds to escape,
then the portal will disapear.
 
LoL, comeon its not hard ^.-

PHP:
local Locations = 
    {
        ["temple"] = {1000, 1000, 7},
        ["depot"] = {447, 447, 7},
        ["ass"] = {454, 654, 6}
    }

local noobConfig = 
    {
        timeToRemove = 10,    --in seconds
        manaReq = 500,
        soulReq = 10,
        levelReq = 70
    }

local function doRemoveTeleport(x)
    doRemoveItem(getThingFromPos(x.p).uid)
end  

local function LookPos(cid)
    local pos = getCreaturePosition(cid)
    local nPos = {
        [0]={x=pos.x, y=pos.y-1, z=pos.z}, 
        [1]={x=pos.x+1, y=pos.y, z=pos.z}, 
        [2]={x=pos.x, y=pos.y+1, z=pos.z}, 
        [3]={x=pos.x-1, y=pos.y, z=pos.z}}
    return nPos[getPlayerLookDir(cid)]
end

function onSay(cid, words, param)
    local STOP = FALSE
    local toPosition = Locations[param]
    if toPosition then
        if getPlayerLevel(cid) >= noobConfig.levelReq then
            if getCreatureMana(cid) >= noobConfig.manaReq then
                if getPlayerSoul(cid) >= noobConfig.soulReq then
                    if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
                        local fromPosition = LookPos(cid)
                        fromPosition.stackpos = 1
                        local i = getThingFromPos(fromPosition)
                        if i.itemid > 0 then
                            if hasProperty(i.uid, CONST_PROP_BLOCKPATHFIND) == TRUE then
                                STOP = TRUE
                            end
                        end
                        if STOP == FALSE then
                            doCreateTeleport(1387, {x=toPosition[1], y=toPosition[2], z=toPosition[3]}, fromPosition)
                            doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
                            addEvent(doRemoveTeleport, 1000 * noobConfig.timeToRemove, {p = fromPosition})
                        else
                            doPlayerSendTextMessage(cid, 22, "BLAH BLAH BLAH A ITEM BLOCK WAY.")
                        end
                    else
                        doPlayerSendTextMessage(cid, 22, "BLAH BLAH YOU IN FIGHT.")
                    end
                else
                    doPlayerSendTextMessage(cid, 22, "You need " .. noobConfig.soulReq .. " soul points to create a teleport.")
                end
            else 
                doPlayerSendTextMessage(cid, 22, "You need " .. noobConfig.manaReq .. " mana points to create a teleport.")
            end
        else
            doPlayerSendTextMessage(cid, 22, "You need level " .. noobConfig.levelReq .. " to create a teleport.")
        end
    else
        doPlayerSendTextMessage(cid, 22, "BLAH BLAH BLAH NOT CORRECT PARAM.")
    end
    return TRUE
end

someone fix the stackpos stuff ^.-
 
Back
Top