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

1 more question.

cake

Banned User
Joined
Jul 24, 2010
Messages
838
Reaction score
58
Location
good or bad,
Okay, I've provided a picture to make it more easy to understand.

nlo4yb.png


Explanation of what I want:

1.

If you stand on this, 2. will be visible. If you go away, 2. will disappear.

2.

Pulling it will make 3. visible, pulling it back will make it disappear - if the lever (2., itself) disappears, then 3. will disappear aswell.

3.

Standing on this will make 4. appear - if you leave the tile then 4. will disappear.
Again, if 1. or 2. disappears, it will disappear aswell.

4.

Pulling this will make the MWalls (5.) disappear for 5 seconds. After 5 seconds, they are visible again & the lever will automaticly be pulled back.
Again, if 1., 2. or 3. disappears, will the lever disappear aswell.

5.

Will disappear for 5 seconds if 4. is pulled, if 4. is pulled back, then they will appear. 4. will automaticly be pulled back after 5 seconds.




Is that possible?
 
Cake, I just woke up and going to eat breakfust, but if none have fixed the scripts for you when I come back I'll fix them for you..

I think it take about 5 minutes to fix the scripts and than about 1 minute of you to configure them to your server.

see ya in a while


ps: meanwhile. PM me for 4 not used action ids that I can use for the special tiles and switches.
 
switches (action):
Code:
local config = {
	-- Positions of mwalls, you can add as many as u want.
	mwalls = {
		{x = 100, y = 100, z = 7}
	},
	-- Position of tile (3. @ ur picture)
	tilePos = {x = 1, y = 1, z = 7, stackpos = STACKPOS_GROUND}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.uid == xxxx) then -- xxxx is UID of switch (2. @ ur picture)
		local floor = getThingFromPos(config.tilePos).uid
		doTransformItem(floor.uid, floor.itemid == 405 and 426 or 405)
		doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	elseif(item.uid == yyyy) then -- yyyy is UID of switch (4. @ ur picture)
		if(item.itemid == 1945) then
			for _, pos in ipairs(config.mwalls) do
				local mwall = getTileItemById(pos, 1497).uid
				if(mwall > 0) then
					doRemoveItem(mwall)
				end
				addEvent(doCreateItem, 5 * 1000, 1497, pos)
			end
			addEvent(function() doTransformItem(getTileItemById(fromPosition, 1946).uid, 1945) end, 5 * 1000)
			doTransformItem(item.uid, 1946)
		end
	end
	return true
end

tiles (movement):
Code:
local config = {
	[UID_OF_TILE_1] = {
		12001, -- UID of created switch. when step-in @ first tile.
		{x =1, y = 1, z = 7} -- POS of created swtich when step-in @ first tile.
	},
	[UID_OF_TILE_2] = {
		12001, -- Same as above, but for second tile.
		{x =1, y = 1, z = 7} -- Same as above, but for second tile.
	}
}

-- Don't touch the rest below.
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(not isPlayer(cid)) then return end
	local cfg = config[item.uid]
	if(cfg) then
		local uid = doCreateItem(cfg[2], 1945)
		doItemSetAttribute(uid, "uid", cfg[2])
	end
end

function onStepOut(cid, item, position, fromPosition)
	if(not isPlayer(cid)) then return end
	local cfg = config[item.uid]
	if(cfg) then
		local l, r = getTileItemById(cfg[2], 1945).uid, getTileItemById(cfg[2], 1946).uid
		if(l > 0) then doRemoveItem(l) end
		if(r > 0) then doRemoveItem(r) end
	end
end

Not sure if it'll work, didn't even check spelling, syntax etc. Post errors if it won't work so someone/me will be able to fix it later. ;p
 
Ah okay, I'm at school atm. but I'll try it out when I come home.

For actionID's, uniqueID's, you can use the following:

30001
30002
30004
30005
30006
[...]
 
Back
Top