All pastes #1505690 Raw Edit

Something

public text v1 · immutable
#1505690 ·published 2009-07-24 11:58 UTC
rendered paste body
-- kk I made this as easy as possible so I think you can do it lol... <3
-- level doors based on actionId
-- To make door for level x, create door on map and set its actionid to x+1000 Meaning the ActionID is the whatever you put the action id to however you can't put below 100 :P Because I said so. And you're a nubcakes so just Copy and paste That \/ And put it in a lua file under /actions/scripts and name it leveldoor then add <action itemid="1229" script="leveldoor.lua" /> and <action itemid="1227" script="leveldoor.lua" /> side by side in actions.xml in the actions folder
 
 function onUse(cid, item, frompos, item2, topos)
 	reqlevel = item.actionid - 1000	-- actionids below 100 are reserved
 
 	if reqlevel > 0 then
 		if getPlayerLevel(cid) >= reqlevel 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 1
 			end
 
 			doTeleportThing(cid,pos)
 			doSendMagicEffect(topos,12)
 		else
 			doPlayerSendTextMessage(cid,22,'You need level ' .. reqlevel .. ' to pass this door.')
 		end
 		return 1
 	else
 		return 0
 	end
 end