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

fromPos

donacool

Mapper Scripter Ot Owner
Joined
Jan 15, 2010
Messages
97
Reaction score
0
hey everyone this is a script that i made that if you are
level 100+ you can pass but if you are lower you can pass

replace 474 for the tile id
replace 1125 for the uid of the tile(you should add it in the map)
replace 100 for the level you want for the required level


Code:
local tileid = 474
local tileuid = 1125
local levelRequired = 100
local cancel = "You dont have enough level!"
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if isPlayer(cid) and item.itemid == tileid and item.uid == tileuid then
		if getPlayerLevel(cid) < levelRequired then
			doTeleportThing(cid, fromPos, TRUE)
			doPlayerSendCancel(cid, cancel)
		end
		return true
	end
	return true
end
return true
Please give me rep++
 
Code:
local tileuid = 1125
local levelRequired = 100
local cancel = "You dont have enough level!"
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if isPlayer(cid) then
		if item.uid == tileuid then
			if getPlayerLevel(cid) < levelRequired then
				doTeleportThing(cid, fromPosition, true)
				doPlayerSendCancel(cid, cancel)
			end
		end
	end
	return true
end
Why so many return true?
Also, checking item id is just not needed :p
 
Code:
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) and getPlayerLevel(cid) < 100 then
		doTeleportThing(cid, fromPosition, true)
		doPlayerSendCancel(cid, 'You don\'t have enough level!')
	end
end
why define variables when it's not needed?
 
Back
Top