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

[MoveEvent] Teleport with level cap

zkum

corruption
Joined
May 9, 2009
Messages
2,300
Reaction score
52
Location
Sweden
Hello!
Im requesting a script for regular teleports (ID1387) that has a minimum and a maximum level cap.

Example: Only players between level 50-100 can enter, reason is because of higher level players just killing all the monsters and the quest wont be really a challange.

If level to high or to low it would say something like "Only players between level 50 and 100 can enter" with orange text. Also teleport you back 2 steps and the teleport thing effect :)

thanks in advance!

0.3 / 0.4
 
Create a Movement Script named teleportlevel.lua and enter this:
Lua:
local teleports = {
	--[ActionID] = {Min Level, Max Level}
	[1234] = {50, 100},
	[4321] = {100, 150}
}


function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(not isPlayer(cid)) then
		return true
	end

	local teleport = TELEPORTS[item.aid]
	if(not teleport) then
		return true
	end

	if getPlayerLevel(cid) => teleport[1] and getPlayerLevel(cid) <= teleport[2] then
		return true
	end

	doTeleportThing(cid, fromPosition, true)
	return true
end

Then in the movements.xml add:
Code:
<movevent type="StepIn" itemid="1387" event="script" value="teleportlevel.lua"/>

Made a quick fix to make them step back.
 
looks nice, but what should i do if i want a orange text that says u cant go in? :)
gonna try it out now though! thx
 
Back
Top