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

[Action] 2 scripts please help

Knight God

Member
Joined
Oct 19, 2008
Messages
1,180
Reaction score
21
I need a script that can remove more than two walls and two or more walls appear but elsewhere. Make it easy to configure, if possible please.

the other script is that if a character makes a quest, this gives you an item that is random and that every 24 hours this quest are able to do again.
please help with this request.
thanks in advance.
 
Last edited:
Yes, you can add more walls.

e.g.
LUA:
local WALL_LEVER = {
	[1515] = {
		wall1pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall2pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall3pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall4pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall5pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall6pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall7pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall8pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall1itemid = 1025,
		wall2itemid = 1025,
		wall3itemid = 1025,
		wall4itemid = 1025,
		wall5itemid = 1025,
		wall6itemid = 1025,
		wall7itemid = 1025
		wall8itemid = 1025
	}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local wall_lever = WALL_LEVER[item.actionid]
	if(getTileThingByPos(wall_lever.wall1pos).itemid == wall_lever.wall1itemid) then
		doRemoveItem(getTileThingByPos(wall_lever.wall1pos).uid, 1)
		doRemoveItem(getTileThingByPos(wall_lever.wall2pos).uid, 1)
		doRemoveItem(getTileThingByPos(wall_lever.wall3pos).uid, 1)
		doRemoveItem(getTileThingByPos(wall_lever.wall4pos).uid, 1)
		doCreateItem(wall5itemid, 1, wall_lever.wall5pos)
		doCreateItem(wall6itemid, 1, wall_lever.wall6pos)
		doCreateItem(wall7itemid, 1, wall_lever.wall7pos)
		doCreateItem(wall8itemid, 1, wall_lever.wall8pos)
	else
		doCreateItem(wall1itemid, 1, wall_lever.wall1pos)
		doCreateItem(wall2itemid, 1, wall_lever.wall2pos)
		doCreateItem(wall3itemid, 1, wall_lever.wall3pos)
		doCreateItem(wall4itemid, 1, wall_lever.wall4pos)
		doRemoveItem(getTileThingByPos(wall_lever.wall5pos).uid, 1)
		doRemoveItem(getTileThingByPos(wall_lever.wall6pos).uid, 1)
		doRemoveItem(getTileThingByPos(wall_lever.wall7pos).uid, 1)
		doRemoveItem(getTileThingByPos(wall_lever.wall8pos).uid, 1)
	end
 
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
In this case, when you use the lever, 4 walls will be removed from one position and 4 new walls will be created on another position. Ofc it can be made simplified by using loops but I don't wanna complicate it too much and I'm pretty much lazy today :p
 
Last edited:
you could add a cooldown?
For example:
if I move the lever has only 30 minutes to go
and walls after returning to the place they were before moving
the lever?


sorry for the inconvenience :/
 
This.
LUA:
local WALL_LEVER = {
	[1515] = {
		wall1pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall2pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall3pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall4pos = {x = ?, y = ?, z = ?, stackpos = STACKPOS_GROUND},
		wall1itemid = 1025,
		wall2itemid = 1025,
		wall3itemid = 1025,
		wall4itemid = 1025
	}
}

local function RemoveWalls()
	doCreateItem(wall1itemid, 1, wall_lever.wall1pos)
	doCreateItem(wall2itemid, 1, wall_lever.wall2pos)
	doRemoveItem(getTileThingByPos(wall_lever.wall3pos).uid, 1)
	doRemoveItem(getTileThingByPos(wall_lever.wall4pos).uid, 1)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local wall_lever = WALL_LEVER[item.actionid]
	if(getTileThingByPos(wall_lever.wall1pos).itemid == wall_lever.wall1itemid) then
		doRemoveItem(getTileThingByPos(wall_lever.wall1pos).uid, 1)
		doRemoveItem(getTileThingByPos(wall_lever.wall2pos).uid, 1)
		doCreateItem(wall3itemid, 1, wall_lever.wall3pos)
		doCreateItem(wall4itemid, 1, wall_lever.wall4pos)
		addEvent(RemoveWalls(), 30 * 60 * 1000)
	else
		RemoveWalls()
	end
 
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Back
Top