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

Level tile help! :D

cirtaboy

Offensive if u r jew 卍
Joined
Jul 31, 2008
Messages
1,946
Reaction score
19
Location
Sweden
Does anyone have a script that would work like this.

If a player walks on a tile with a certain aid and is under level 50, he will be pushed back 2 steps to the right and get a message in red that he is too low level!

Many thanks if found or made. ^_^
 
Lua:
function onStepIn(cid, item, position, fromPosition)
local new = {x= 4252, y=4337, z=9}
	if isPlayer(cid) and getPlayerLevel(cid) >= 50 then
	   doTeleportThing(cid, new)
	else
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Too low level bitch.")
end
return true
end
 
Try this :


PHP:
function onStepIn(cid, item, position, fromPosition)

if isPlayer(cid) == false then
return true
end

local levelRequired = item.actionid-1000
local playerLevel = getPlayerLevel(cid)

	if item.itemid == 3177 and item.actionid > 100 and playerLevel < levelRequired then
		
		
		
		doTeleportThing(cid, fromPosition, false)
		doSendMagicEffect(fromPosition, 31)
		doCreatureSay(cid, "You must be level ".. levelRequired .." to enter.", TALKTYPE_ORANGE_1)
end
	return true
end


and in xml :

PHP:
       <!-- Level Tile -->
        <movevent type="StepIn" itemid="3177" event="script" value="level_tile.lua"/>
 
try this :


PHP:
function onstepin(cid, item, position, fromposition)

if isplayer(cid) == false then
return true
end

local levelrequired = item.actionid-1000
local playerlevel = getplayerlevel(cid)

	if item.itemid == 3177 and item.actionid > 100 and playerlevel < levelrequired then
		
		
		
		doteleportthing(cid, fromposition, false)
		dosendmagiceffect(fromposition, 31)
		docreaturesay(cid, "you must be level ".. Levelrequired .." to enter.", talktype_orange_1)
end
	return true
end


and in xml :

PHP:
       <!-- level tile -->
        <movevent type="stepin" itemid="3177" event="script" value="level_tile.lua"/>

lol?
 
Back
Top