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

Looking for simple teleport script

tiddpd

PHP Scripter
Joined
Apr 16, 2008
Messages
331
Reaction score
0
I am looking for a simple teleport script for a lever that when pulled it will teleport however many players are standing in the spots (maximum of 4) to a spot. Without having to have a storage value... or spawning any monsters or anything like that. Just a simple teleport.
 
Here you go:

PHP:
local playerPosition =
{
	{x = 56, y = 143, z = 7, stackpos = STACKPOS_TOP_CREATURE},
	{x = 57, y = 143, z = 7, stackpos = STACKPOS_TOP_CREATURE},
	{x = 58, y = 143, z = 7, stackpos = STACKPOS_TOP_CREATURE},
	{x = 57, y = 144, z = 7, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
	{x = 57, y = 139, z = 7},
	{x = 57, y = 139, z = 7},
	{x = 57, y = 139, z = 7},
	{x = 57, y = 139, z = 7}
}
local player = {0, 0, 0, 0}
local failed = TRUE

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		for i = 1, 4 do
			player[i] = getThingfromPos(playerPosition[i])
			if player[i].itemid > 0 then
				if isPlayer(player[i].uid) == TRUE then
				end
			end

			if failed == TRUE then
				doPlayerSendCancel(cid, "Sorry, not possible.")
				return TRUE
			end

			failed = TRUE
		end

		for i = 1, 4 do
			doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
			doTeleportThing(player[i].uid, newPosition[i], FALSE)
			doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
		end
		doTransformItem(item.uid, item.itemid + 1)
	elseif item.itemid == 1946 then
	doTransformItem(item.uid, item.itemid - 1)
	end

	return TRUE
end

You just need to edit the positions:

playerPosition
newPosition
 
yeah i gave you rep.. and it seems the script isnt working either... only thing is its hard to find out whats wrong because it doesnt give any error... jut a sorry not possible
 
Last edited:
Back
Top