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

Action: Mass Teleportation.

druidspammer

New Member
Joined
Aug 29, 2008
Messages
37
Reaction score
0
Greetings my fellow men. I have come across quite the embarrasing scripting issue.
I've tried to search for it, But i got hundreds of results for weird teleport scripts.



As you can see on the collored dots, I want the collored area in the tp area to teleport to the corresponding collored area in the cage. All of it will be triggered by a GM char standing on the marked spot pulling that switch. I do not want it to be set that all "teleport spots" have to be filled to make the teleport trigger, I want it to work just as well with 3 persons as with a full team. Any awesome souls out there feel like helping me out? rep++ in reward.

Sincerley: Druidspammer
 
LUA:
local pos = { 	-- color pos where they stand		-- pos for corresponding color
				{ standpos = { x= 960, y = 1002, z = 7 } , teleportpos = { x= 960, y = 1009, z = 7 } },
				{ standpos = { x= 956, y = 1005, z = 7 }  , teleportpos = { x= 963, y = 1007, z = 7 } },
				{ standpos = { x= 956, y = 1007, z = 7 } , teleportpos = { x= 963, y = 1005, z = 7 } }
				
			}
local players = 0		
function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	if getPlayerGroupId(cid) < 3 then
		return doPlayerSendCancel(cid,"Only Gm's can use that.") and doSendMagicEffect(toPosition,2)
	end
	
	for i = 1,#pos do 
		local mainCheck = getTopCreature( pos[i].standpos).uid
		local tpto = pos[i].teleportpos
		if mainCheck > 0 and isPlayer(mainCheck) then
			doTeleportThing(mainCheck,tpto)
			doSendMagicEffect(tpto,10)
			players = players + 1
		end
	end
	
	
	return 	doPlayerSendTextMessage(cid,27, players.." "..( players == 1 and "player was teleported." or players > 1 and "players were teleported." or "no players were teleported.")) and doTransformItem(item.uid, item.uid == 1945 and 1946 or 1945)
end
 
its no problem :D use this scripts :)
Code:
local arenas = {

	[10040] = {

		fromPos ={

			{x = 32389, y = 32189, z = 7},

			{x = 32389, y = 32190, z = 7},

			{x = 32389, y = 32191, z = 7},

			{x = 32389, y = 32192, z = 7},

			{x = 32389, y = 32193, z = 7},

			{x = 32390, y = 32189, z = 7},

			{x = 32390, y = 32190, z = 7},

			{x = 32390, y = 32191, z = 7},

			{x = 32390, y = 32192, z = 7},

			{x = 32390, y = 32193, z = 7},

			{x = 32391, y = 32189, z = 7},

			{x = 32391, y = 32190, z = 7},

			{x = 32391, y = 32191, z = 7},

			{x = 32391, y = 32192, z = 7},

			{x = 32391, y = 32193, z = 7},

			{x = 32392, y = 32189, z = 7},

			{x = 32392, y = 32190, z = 7},

			{x = 32392, y = 32191, z = 7},

			{x = 32392, y = 32192, z = 7},

			{x = 32392, y = 32193, z = 7},

			{x = 32393, y = 32189, z = 7},

			{x = 32393, y = 32190, z = 7},

			{x = 32393, y = 32191, z = 7},

			{x = 32393, y = 32192, z = 7},

			{x = 32393, y = 32193, z = 7}



											--you can add how much you want, there are no limits

		},

		toPos = {

			{x = 33048, y = 33057, z = 7},	--player 1 teleport position

			{x = 33048, y = 33058, z = 7},	--player 2 teleport position

			{x = 33048, y = 33059, z = 7},

			{x = 33048, y = 33060, z = 7},

			{x = 33048, y = 33061, z = 7},

			{x = 33049, y = 33057, z = 7},

			{x = 33049, y = 33058, z = 7},

			{x = 33049, y = 33059, z = 7},

			{x = 33049, y = 33060, z = 7},

			{x = 33049, y = 33061, z = 7},

			{x = 33050, y = 33057, z = 7},

			{x = 33050, y = 33058, z = 7},

			{x = 33050, y = 33059, z = 7},

			{x = 33050, y = 33060, z = 7},

			{x = 33050, y = 33061, z = 7},

			{x = 33051, y = 33057, z = 7},

			{x = 33051, y = 33058, z = 7},

			{x = 33051, y = 33059, z = 7},

			{x = 33051, y = 33060, z = 7},

			{x = 33051, y = 33061, z = 7},

			{x = 33052, y = 33057, z = 7},

			{x = 33052, y = 33058, z = 7},

			{x = 33052, y = 33059, z = 7},

			{x = 33052, y = 33060, z = 7},

			{x = 33052, y = 33061, z = 7}

							

										--you can add how much you want, there are no limits

		}

	}

}

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

	if(item.itemid == 1946) then

		doTransformItem(item.uid, 1945)

		return TRUE

	end

 

	local arena = arenas[item.uid]

	if(not arena) then

		return FALSE

	end

 

	local players = {}

	for _, pos in pairs(arena.fromPos) do

		pos.stackpos = STACKPOS_TOP_CREATURE

		local tmp = getThingfromPos(pos).uid

		if(tmp > 0 and isCreature(tmp) == TRUE) then

			table.insert(players, tmp)

		end

	end

 

	if(table.maxn(players) < table.maxn(arena.fromPos)) then

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need more creatures for duel.")

		return TRUE

	end

 

	for i, pid in pairs(players) do

		doSendMagicEffect(arena.fromPos[i], CONST_ME_POFF)

		doTeleportThing(pid, arena.toPos[i])

		doSendMagicEffect(arena.toPos[i], CONST_ME_TELEPORT)

		doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, "FIGHT!")

	end

 

	return TRUE

end
 
Back
Top