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

teleport destnation depend on lvl

kimokimo

Kimo
Joined
Jan 25, 2011
Messages
821
Solutions
6
Reaction score
156
GitHub
karimadnan
can anyone make script if player got lvl 100 he teleport to 1000,1000,7 if 200 teleport to ....,....,. like this :) +rep
 
LUA:
local level = {
	[1] = {
		dest = {x = 1000, y = 1000, z = 7},
		min = 100,
		max = 200
	},
	[2] = {
		dest = {x = 1001, y = 1001, z = 8},
		min = 200,
		max = 300
	}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	for _, v in pairs(level) do
		if(getPlayerLevel(cid) < v.min and getPlayerLevel(cid) > v.max) then
			return doTeleportThing(cid, v.dest), doSendMagicEffect(v.dest, CONST_ME_TELEPORT)
		end
	end
	doTeleportThing(cid, fromPosition)
	return true
end
 
can anyone put when the player enter the teleport if he have lvl 100 to 200 it say entering to first floor, from 200 to 300 second floor orange msg
 
LUA:
local level = {
	[1] = {
		dest = {x = 1000, y = 1000, z = 7},
		min = 100,
		max = 200,
		msg = 'You have entered the first floor.'
	},
	[2] = {
		dest = {x = 1001, y = 1001, z = 8},
		min = 200,
		max = 300,
		msg = 'You have entered the second floor.'
	}
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	for _, v in pairs(level) do
		if(getPlayerLevel(cid) < v.min and getPlayerLevel(cid) > v.max) then
			return doTeleportThing(cid, v.dest), doSendMagicEffect(v.dest, CONST_ME_TELEPORT), doCreatureSay(cid, v.msg, TALKTYPE_ORANGE_1)
		end
	end
	doTeleportThing(cid, fromPosition)
	return true
end

Obviously credits to teckman.
 
Back
Top