• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Level tiles

Fady

Anderion.net
Joined
Aug 13, 2009
Messages
572
Reaction score
17
Location
Egypt
hello, i have just tried to make a tile where u can stand on it if you are atleast level 2,000.
but it didn't work with me :/
heres the script:
Code:
<movevent type="StepIn" uniqueid="7896" event="script" value="leveltile.lua"/>
Code:
function onStepIn(cid, item, pos)
	local newPosition = {x = position.x, y = position.y, z = position.z}
	reqlevel = 2000 
 
	if reqlevel > 0 then
		if getPlayerLevel(cid) >= reqlevel then
			pos = getPlayerPosition(cid)
			doPlayerSendTextMessage(cid,22,'You can pass Safly')

		else
		newPosition.y = newPosition.y - 1
		doTeleportThing(cid,pos)
		doPlayerSendTextMessage(cid,22,'You need level ' .. reqlevel .. ' to pass Area')
			
		end
		return 1
	else
		return 0
	end
end
anyone can fix it please? :]
 
I've revamped it a little bit:

LUA:
function onStepIn(cid, item, pos)
	local newPosition = {x = position.x, y = position.y, z = position.z}
	local reqLevel = 2000 
 
	if getPlayerLevel(cid) >= reqLevel then
		doPlayerSendTextMessage(cid, 22, 'You can pass safely.')
	else
		newPosition.y = newPosition.y - 1
		doTeleportThing(cid, newPosition)
		doPlayerSendTextMessage(cid, 22,'You need level ' .. tostring(reqLevel) .. ' to access this area.')	
	end
	
	return true
end
 
LUA:
local req = 2000
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(cid) then
		if getPlayerLevel(cid) >= req then
			doPlayerSendTextMessage(cid, 22, 'You can pass safely')
		else
			doPlayerSendTextMessage(cid, 22, 'You need to be at least level '..req..' or higher to pass!')
			doTeleportThing(cid, fromPosition)
		end
	end
return TRUE
end
 
Last edited:
LUA:
local req = 2000
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(cid) then
		if getPlayerLevel(cid) >= req then
			doPlayerSendTextMessage(cid, 22, 'You can pass safely')
		else
			doPlayerSendTextMessage(cid, 22, 'You need to be at least level '..req..' or higher to pass!')
			doTeleportThing(cid, fromPosition)
		end
	end
return TRUE
end
only says 17:21 You need to be at least level 2000 or higher to pass! but i can pass anyway lol
 
Back
Top