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

Lever teleport

xLosT

Member
Joined
Jan 11, 2010
Messages
1,021
Reaction score
13
Location
Brasil, Rio Grande do Sul
i need lever teleport exemple

PHP:
local pos = {
	{x = 1104, y = 948, z = 6},
	{x = 1105, y = 948, z = 6},
	{x = 1106, y = 948, z = 6},
	{x = 1107, y = 948, z = 6},
	{x = 1109, y = 948, z = 6},
	{x = 1110, y = 948, z = 6},
	{x = 1111, y = 948, z = 6},
	{x = 1112, y = 948, z = 6}
}
local newpos = {
	{x = 1103, y = 956, z = 7},
	{x = 1103, y = 959, z = 7},
	{x = 1105, y = 954, z = 7},
	{x = 1105, y = 961, z = 7},
	{x = 1110, y = 954, z = 7},
	{x = 1110, y = 961, z = 7},
	{x = 1112, y = 956, z = 7},
	{x = 1112, y = 959, z = 7}
 
use on lever is ok? :)

LUA:
local pos = {
	{x = 1104, y = 948, z = 6},
	{x = 1105, y = 948, z = 6},
	{x = 1106, y = 948, z = 6},
	{x = 1107, y = 948, z = 6},
	{x = 1109, y = 948, z = 6},
	{x = 1110, y = 948, z = 6},
	{x = 1111, y = 948, z = 6},
	{x = 1112, y = 948, z = 6}
}
local newpos = {
	{x = 1103, y = 956, z = 7},
	{x = 1103, y = 959, z = 7},
	{x = 1105, y = 954, z = 7},
	{x = 1105, y = 961, z = 7},
	{x = 1110, y = 954, z = 7},
	{x = 1110, y = 961, z = 7},
	{x = 1112, y = 956, z = 7},
	{x = 1112, y = 959, z = 7}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == 1945 or item.itemid == 1946) then
		doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)

	local players = {}
	for _, fp in ipairs(pos) do
		local pid = getTopCreature(fp).uid
		if(pid > 0 and isPlayer(pid) then
			table.insert(players, pid)
		end
	end
	for i, pid in ipairs(players) do
		doSendMagicEffect(pos[i], CONST_ME_POFF)
		doTeleportThing(pid, newpos[i], false)
		doSendMagicEffect(newpos[i], CONST_ME_ENERGYAREA)
	end

	return true
end
 
Back
Top