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

kamilcioo

Veteran OT User
Joined
Jul 25, 2008
Messages
977
Solutions
1
Reaction score
289
beztytuukqj.jpg

How to make it work.
 
Rep+
Give door action ID 7284
Actions.xml add
Code:
    <action actionid="7284" event="script" value="leveldoori.lua"/>
leveldoori.lua
Lua:
 local ammount = 200 --How much level they need to pass
 local level = getPlayerLevel(cid)
 function onUse(cid, item, frompos, item2, topos)
if level == ammount then
            pos = getPlayerPosition(cid)
            if pos.x == topos.x then
               if pos.y < topos.y then
                  pos.y = topos.y + 1
               else
                  pos.y = topos.y - 1
               end
            elseif pos.y == topos.y then
                   if pos.x < topos.x then
                      pos.x = topos.x + 1
                   else
                      pos.x = topos.x - 1
                   end
            else
                doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
            return true
            end
            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
         else
            doPlayerSendTextMessage(cid,22,"You need "..ammount.." level to pass!") 
         end
         return true
end
 
Code:
<action actionid="XXXX" event="script" value="whateveryouwant.lua"/>
Code:
local level = 100 -- This or higher to pass

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerLevel(cid) => level then
		doTeleportThing(cid, toPosition, true)
		doTransformItem(item.uid, item.itemid+1)
	end
	return true
end
Just change XXXX to whatever actionid you want
@up As it is a door of experience it will close by itself when you walk out of it so you don't need to make it teleport to the other side :p
 
Back
Top