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

[Help] Level door script

Galgula

New Member
Joined
Nov 15, 2007
Messages
28
Reaction score
0
Since i havent figured out how to add a lvl door in TFS i tried to add this script and nothing happen :S

script:
Code:
-- level doors based on actionId
-- to make door for level x create door on map and set its actionid to x+1000

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

in actions:
Code:
<action itemid="1227" script="other/leveldoor.lua" /> 
<action itemid="1229" script="other/leveldoor.lua" />

Do you know what is the problem?
Or can explain me how do i add level doors..
Thx xP
 
Well i still remember if u want an level door u only need to set an actionid

If you wantit for lvl 10+
Actiondid 1010

level 100
actionid 1100

U need to remember u olwais need to add 1000+Lvl as actionid
 
Back
Top Bottom