• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Door quest

Well i dont know any scripts like that, but i guess it would perhaps work if you add a storage value when clicking on the door.
 
Lua:
-- 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
        storage = XXXX  

	if reqlevel > 0 then
		if getPlayerLevel(cid) >= reqlevel and if(getPlayerStorageValue(cid, storage) >= 1 then
			pos = getPlayerPosition(cid)
                        setPlayerStorageValue(cid, storage, 1)
			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 and not passed it before.')
		end
		return 1
	else
		return 0
	end
end
 
Lua:
-- 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
        storage = xxxx  

	if reqlevel > 0 then
		if getplayerlevel(cid) >= reqlevel and if(getplayerstoragevalue(cid, storage) >= 1 then
			pos = getplayerposition(cid)
                        setplayerstoragevalue(cid, storage, 1)
			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 and not passed it before.')
		end
		return 1
	else
		return 0
	end
end
thanks!!!!!!!!!!!
 
Code:
[23/06/2012 12:57:06] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/passrookquest.lua:9: unexpected symbol near 'if'
[23/06/2012 12:57:06] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/passrookquest.lua)
[23/06/2012 12:57:06] data/actions/scripts/quests/passrookquest.lua:9: unexpected symbol near 'if'

8.6 v4 TFS 0.3.6
 
Back
Top