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

Tiles give storage to open door!

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Hello guys, i need a script for a quest that i've made. :)

You need to walk on 4 tiles to open a door. Every tile is in a single room with different monsters.
I guess each tile should give a storage, when u got all storages u will be able to open the door :)
So its kinda like PoI when u have to touch the thrones.

thanks in advance! :w00t:
 
Here is the code for the tiles
PHP:
function onStepIn(cid, item, position, fromPosition)
local storagevalue == x ------ Enter the storage you want to use where X is :P
local storage = getPlayerStorageValue(cid, storagevalue)
setGlobalStorageValue(storage,storagevalue + 1)
return TRUE
end
And then for the door, use a quest door and it's action id to the value used in the script :p
 
Here is the code for the tiles
PHP:
function onStepIn(cid, item, position, fromPosition)
local storagevalue == x ------ Enter the storage you want to use where X is :P
local storage = getPlayerStorageValue(cid, storagevalue)
setGlobalStorageValue(storage,storagevalue + 1)
return TRUE
end
And then for the door, use a quest door and it's action id to the value used in the script :p

Thanks but, i need to copy this one to 4 luas?
 
Tile to set storage:

Lua:
local t = {
	storage = 12345, -- main storage (must match door script)
	[1221] = 1, -- tile action id & storage value
	[1222] = 2,
	[1223] = 3,
	[1224] = 4
}
 
function onStepIn(cid, item, fromPosition, toPosition)
	local k = t[item.actionid]
	if(k and (getPlayerStorageValue(cid, t.storage) ~= k)) then
		setPlayerStorageValue(cid, t.storage, k)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
		doCreatureSay(cid, "MESSAGE HERE!", TALKTYPE_MONSTER)
	end
end

Door script:

Lua:
local storage = 12345

local function doorEnter(cid, uid, id, position)
	doTransformItem(uid, id)
	doTeleportThing(cid, position, true)
	return true
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStorageValue(cid, t.storage) ~= 4) then
		return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This door seems to be sealed against unwanted intruders.")
	end

	return doorEnter(cid, item.uid, item.itemid + 1, toPosition)
end
 
Last edited:
Tile to set storage:

Lua:
local t = {
	storage = 12345, -- main storage (must match door script)
	[1221] = 1, -- tile action id & storage value
	[1222] = 2,
	[1223] = 3,
	[1224] = 4
}
 
function onStepIn(cid, item, fromPosition, toPosition)
	local k = t[item.actionid]
	if(k and (getPlayerStorageValue(cid, t.storage) ~= k)) then
		setPlayerStorageValue(cid, t.storage, k)
	end
end

Door script:

Lua:
local storage = 12345

local function doorEnter(cid, uid, id, position)
	doTransformItem(uid, id)
	doTeleportThing(cid, position, true)
	return true
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStorageValue(cid, t.storage) ~= 4) then
		return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This door seems to be sealed against unwanted intruders.")
	end

	return doorEnter(cid, item.uid, item.itemid + 1, toPosition)
end

Haha lol, it works perfect! just one thing, could you add an effect when i walk on the tiles? like green shimmer and a text like, You touched the tile.
 
Back
Top Bottom