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

Request-script door

Keiro

New Member
Joined
Jun 24, 2009
Messages
285
Reaction score
0
yo , you all know there is a door to enter the annihi room, right?


well i need a script that checks that u are lvl 100 or higher and that also checks ur storage value , ...so the ones that already opened the annihi baults wont be able to pass

do u get it? ;P

thanks you ^^
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {}
	cfg.level = 100
	cfg.storage = 5555
	local cidPosition = getCreaturePosition(cid)
	if getPlayerLevel(cid) >= cfg.level then
		if getPlayerStorageValue(cid, cfg.storage) == 1 then
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, { x = toPosition.x+1, y = toPosition.y, z = toPosition.z }, TRUE)
			else
				doTeleportThing(cid, { x = toPosition.x-1, y = toPosition.y, z = toPosition.z }, TRUE)
			end
		else
			doPlayerSendCancel(cid, "You may not pass this door.")
		end
	else
		doPlayerSendCancel(cid, "You must be level " .. cfg.level .. " to pass.")
	end
	return true
end
 
Last edited:
Freakin JBD u wrote it first than me ja
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {}
	cfg.level = 100
	cfg.storage = 5555
	local cidPosition = getCreaturePosition(cid)
	if getPlayerLevel(cid) >= cfg.level then
		if getPlayerStorageValue(cid, cfg.storage) == 1 then
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, { x = toPosition.x+1, y = toPosition.y, z = toPosition.z }, TRUE)
			else
				doTeleportThing(cid, { x = toPosition.x-1, y = toPosition.y, z = toPosition.z }, TRUE)
			end
		else
			doPlayerSendCancel(cid, "You cannot pass.")
		end
	else
		doPlayerSendCancel(cid, "You must be level " .. cfg.level .. " to pass.")
	end
	return true
end
Then doesnt he have to write action id 1100 to door in map editor?
 
Last edited:
Code:
local t = {
	level = 1000,
	storage = 30015,
	openDoorID = 5112
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == t.openDoorID then
		if getPlayerLevel(cid) >= t.level then
			if getPlayerStorageValue(cid, t.storage) < 1 then
				doTransformItem(item.uid, item.itemid + 1)
				doTeleportThing(cid, toPosition)
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
		end
	end
	return true
end
Code:
	<action uniqueid="30014" event="script" value="quests/anniDoor.lua"/>
 
urs ,repped u , but couldnt make it work :/ it doesnt matter if im lvl 100 or not , or if i got the quest or not, it wont let me pass

PHP:
local t = {
	level = 100,
	storage = 5005,
	openDoorID = 5112
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == t.openDoorID then
		if getPlayerLevel(cid) >= t.level then
			if getPlayerStorageValue(cid, t.storage) < 1 then
				doTransformItem(item.uid, item.itemid + 1)
				doTeleportThing(cid, toPosition)
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
		end
	end
	return true
end

im using the door with id 5112 , as the script says, on map editor and uniqueid 5790

<action uniqueid="5790" event="script" value="other/annidoor.lua" />

tfs 0.3.6 spl1 btw
 
hi, not tested
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
	storage = 45678,
	level = 100
}
	if getPlayerLevel(cid) >= config.level and getPlayerStorageValue(cid, config.storage) > 0 then
		doCreatureSay(cid, "Welcome.", 18)
	else
		doTeleportThing(cid, fromPosition)
		doCreatureSay(cid, "You cannot get in!", 18)
	end
	return true
end
bye
 
Back
Top