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

Solved Teleport script.

Elaney

Member
Joined
Jan 1, 2009
Messages
1,561
Reaction score
12
Location
Sweden
Say x word and get teleported to xxx / xxx / xxx


the script im using atm is

Code:
local standPos = {x=1303,y=828,z=7}
local newPos = {x=1298,y=828,z=7}
 
function onSay(cid, param)
    if comparePos(getPlayerPosition(cid), standPos) then
        doSendMagicEffect(getPlayerPosition(cid), 2)
        doTeleportThing(cid, newPos)
        doSendMagicEffect(newPos, 10)
    end
    return 1
end

TFS 0.2
 
Last edited:
Code:
local playerPosition =

{
	{x = 1303, y = 828, z = 7, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
	{x = 1298, y = 828, z = 7}
}
 
local player = {}
local failed = TRUE
 
 
function onSay(cid, words, param)
for i = 1, #playerPosition do
player[i] = getThingfromPos(playerPosition[i])
    if isPlayer(player[i].uid) == TRUE then
    
    failed = FALSE
	
	if failed == TRUE then
				doPlayerSendCancel(cid, "Sorry, not possible.")
				
				return TRUE
			end

			failed = TRUE
		end
		
		for i = 1, #playerPosition do
			doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
			doTeleportThing(player[i].uid, newPosition[i], FALSE)
			doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
		end
		
		return TRUE
end
end

Code:
<talkaction words="your word" script="xxxx.lua"/>

Maybe It work I don't check
 
Code:
local playerPosition =

{
	{x = 1303, y = 828, z = 7, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
	{x = 1298, y = 828, z = 7}
}
 
local player = {}
local failed = TRUE
 
 
function onSay(cid, words, param)
for i = 1, #playerPosition do
player[i] = getThingfromPos(playerPosition[i])
    if isPlayer(player[i].uid) == TRUE then
    
    failed = FALSE
	
	if failed == TRUE then
				doPlayerSendCancel(cid, "Sorry, not possible.")
				
				return TRUE
			end

			failed = TRUE
		end
		
		for i = 1, #playerPosition do
			doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
			doTeleportThing(player[i].uid, newPosition[i], FALSE)
			doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
		end
		
		return TRUE
end
end

Code:
<talkaction words="your word" script="xxxx.lua"/>

Maybe It work I don't check

Thanks worked <3 rep added
 
Back
Top