• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Portal Only Available When..

Lakh

Banned User
Joined
Aug 17, 2011
Messages
189
Reaction score
4
Location
Göteborg, Sweden
Hello, I am wondering if there is a way to only make a certain portal available when a player has completed 7 missions?
 
so like.. ??

LUA:
local storages {
	[1] storage = "xxx",
	[2] storage = "xxx",
	[3] storage = "xxx",
	[4] storage = "xxx",
	[5] storage = "xxx",
	[6] storage = "xxx",
	[7] storage = "xxx",
	}
		function onStepIn(cid,frompos,topos)
			if getPlayerStorageValue isinArray 1,2,3,4,5,6,7 then
	etc..
 
so like.. ??

LUA:
local storages {
	[1] storage = "xxx",
	[2] storage = "xxx",
	[3] storage = "xxx",
	[4] storage = "xxx",
	[5] storage = "xxx",
	[6] storage = "xxx",
	[7] storage = "xxx",
	}
		function onStepIn(cid,frompos,topos)
			if getPlayerStorageValue isinArray 1,2,3,4,5,6,7 then
	etc..

Looks like you are doing it better :P anyways...

LUA:
local storage = xxxx
local pStorage = getPlayerStorageValue(cid, storage)
local nPos = {x = aaa, y = bbb, z= ccc}
function onStepIn(cid, item, pos, fromPos)
	if (isPlayer(cid)) then
		if pStorage < 1 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "In order to enter this portal, first you have to do the 7 fuckin missions")
		elseif pStorage >= 1 and pStorage < 2 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 1 mission done there are 6 left")
		elseif pStorage >= 2 and pStorage < 3 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 2 mission done there are 5 left")
		elseif pStorage >= 3 and pStorage < 4 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 3 mission done there are 4 left")
		elseif pStorage >= 4 and pStorage < 5 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 4 mission done there are 3 left")
		elseif pStorage >= 5 and pStorage < 6 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 5 mission done there are 2 left")
		elseif pStorage >= 6 and pStorage < 7 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You almost finish you already have done 6 missions, go and find the final one and you'll be able to enter the telepor")
		elseif pStorage >= 7 then
			doTeleportThing(cid, nPos)
			doSendMagicEffect(nPos, CONST_ME_ENERGYAREA)
			doPlayerSendTextMessage(nPos, MESSAGE_EVENT_ADVANCE, "You are now inside")
		end
	else
	return TRUE
	end
	return TRUE
end

I don't know if it works :P try it out
 
Looks like you are doing it better :P anyways...

LUA:
local storage = xxxx
local pStorage = getPlayerStorageValue(cid, storage)
local nPos = {x = aaa, y = bbb, z= ccc}
function onStepIn(cid, item, pos, fromPos)
	if (isPlayer(cid)) then
		if pStorage < 1 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "In order to enter this portal, first you have to do the 7 fuckin missions")
		elseif pStorage >= 1 and pStorage < 2 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 1 mission done there are 6 left")
		elseif pStorage >= 2 and pStorage < 3 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 2 mission done there are 5 left")
		elseif pStorage >= 3 and pStorage < 4 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 3 mission done there are 4 left")
		elseif pStorage >= 4 and pStorage < 5 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 4 mission done there are 3 left")
		elseif pStorage >= 5 and pStorage < 6 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 5 mission done there are 2 left")
		elseif pStorage >= 6 and pStorage < 7 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You almost finish you already have done 6 missions, go and find the final one and you'll be able to enter the telepor")
		elseif pStorage >= 7 then
			doTeleportThing(cid, nPos)
			doSendMagicEffect(nPos, CONST_ME_ENERGYAREA)
			doPlayerSendTextMessage(nPos, MESSAGE_EVENT_ADVANCE, "You are now inside")
		end
	else
	return TRUE
	end
	return TRUE
end

I don't know if it works :P try it out

Shortened:
LUA:
local storage = xxxx
local nPos = {x = aaa, y = bbb, z= ccc}
function onStepIn(cid, item, pos, fromPos)
	return isPlayer(cid) and (getPlayerStorageValue(cid, storage) == 7 and (doTeleportThing(cid, nPos) and doSendMagicEffect(nPos, CONST_ME_TELEPORT)) or doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, (getPlayerStorageValue(cid, storage) > 0 and "You've done only " .. getPlayerStorageValue(cid, storage) .. " missions, there " .. (getPlayerStorageValue(cid, storage) == 6 and "is " or "are ") .. 7 - (getPlayerStorageValue(cid, storage) .. " missions left.") or "You haven't done any mission at all, there are 7 missions left."))) or true
end
 
Shortened:
LUA:
local storage = xxxx
local nPos = {x = aaa, y = bbb, z= ccc}
function onStepIn(cid, item, pos, fromPos)
	return isPlayer(cid) and (getPlayerStorageValue(cid, storage) == 7 and (doTeleportThing(cid, nPos) and doSendMagicEffect(nPos, CONST_ME_TELEPORT)) or doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, (getPlayerStorageValue(cid, storage) > 0 and "You've done only " .. getPlayerStorageValue(cid, storage) .. " missions, there " .. (getPlayerStorageValue(cid, storage) == 6 and "is " or "are ") .. 7 - (getPlayerStorageValue(cid, storage) .. " missions left.") or "You haven't done any mission at all, there are 7 missions left."))) or true
end


fuck i wanna script like u D:
 
LUA:
local storage = {
	123, 456, 789
}

function onStepIn(cid, fromPosition, toPosition)
	if getPlayerStorageValue(cid, table.maxn(storage)) < 1 then
		doTeleportThing(cid, fromPosition, true)
	end
end

LUA:
local storage = {
	123, 456, 789
}

function onStepIn(cid, fromPosition, toPosition)
	for i = 1, #storage do
		if getPlayerStorageValue(cid, storage[i]) < 1 then
			doTeleportThing(cid, fromPosition, true)
		end
	end
end
 
Last edited:
Back
Top