• 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:
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.

more detailed
 
LUA:
local t = {
-- from, to, id[, count]
	{1, 36}, -- will be empty =P
	{37, 46, 2148, 80},
	{47, 55, 2148, 50},
	{56, 64, 2671, 5},
	{65, 73, 2789, 5},
	{74, 81, 7620},
	{82, 87, 7618},
	{88, 92, 9811},
	{93, 96, 9808},
	{97, 100, 2213}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if os.time() - getCreatureStorage(cid, 5) >= 86400 then
		doCreatureSetStorage(cid, 5, os.time())
		local r = math.random(100)
		for i = 1, #t do
			local k = t[i]
			if r >= k[1] and r <= k[2] then
				if k[3] then
					local id, n = k[3], k[4] or 1
					local a = getItemInfo(id)
					doPlayerAddItem(cid, id, n)
					doCreatureSay(cid, 'You found ' .. (n == 1 and ((a.article == '' and '' or a.article .. ' ') .. a.name) or n .. ' ' .. a.plural) .. '.', TALKTYPE_ORANGE_1)
				else
					doCreatureSay(cid, 'You found nothing useful.', TALKTYPE_ORANGE_1)
				end
				break
			end
		end
	else
		doCreatureSay(cid, 'You found nothing useful.', TALKTYPE_ORANGE_1)
	end
	return true
end
 
Ofc possible :o do just puta table of items , use math.random to choose from them , and then put exhause timeon it, exhaust.set(cid,storage,timein seconds)
 
wall_lever.lua:
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
	}
}
 
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)
	else
		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
 
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end

In actions.xml:
XML:
	<action actionid="?" event="script" value="wall_lever.lua"/>
 
Last edited:
Back
Top