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

switch problem

tofik1432

New Member
Joined
Jun 20, 2009
Messages
162
Reaction score
0
how can i make the switch work on (for example ) rock ??
( i want DHQ and ANNI like rl ;] )
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local stone = {x=846, y=868, z=8, stackpos=1} -- Chance this coordinates to your stone coordinates.
local getstone = getThingfromPos(stone)
	if item.uid == 50331 and item.itemid == 1945 then
		doRemoveItem(getstone.uid,1)
		doTransformItem(item.uid, 1946)
	else
		doCreateItem(1304, stone)
		doTransformItem(item.uid, 1945)
	end
end
 
Anni lever

Lua:
local playerPosition =
{
	{x = 33222, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 33223, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 33224, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 33225, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
	{x = 33219, y = 31659, z = 13},
 	{x = 33220, y = 31659, z = 13},
	{x = 33221, y = 31659, z = 13},
	{x = 33222, y = 31659, z = 13}
}

-- Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = FALSE

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		for i = 1, 4 do
			failed = TRUE
			player[i] = getThingfromPos(playerPosition[i])
			if player[i].itemid > 0 then
				if isPlayer(player[i].uid) == TRUE then
					if getPlayerStorageValue(player[i].uid, 30015) == -1 then
						if getPlayerLevel(player[i].uid) >= 100 then
							failed = FALSE
						end
					end
				end
			end
			if failed == TRUE then
				doPlayerSendCancel(cid, "Sorry, not possible.")
				return TRUE
			end
		end
		for i = 1, 4 do
			doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
			doTeleportThing(player[i].uid, newPosition[i], FALSE)
			doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
		end
		doTransformItem(item.uid, item.itemid + 1)
	elseif item.itemid == 1946 then
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	return TRUE
end

Anni quest chest

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   	if item.uid == 2000 then
		queststatus = getPlayerStorageValue(cid,6076)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a demon armor.")
   			doPlayerAddItem(cid,2494,1)
   			setPlayerStorageValue(cid,6076,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
   		end
   	elseif item.uid == 2001 then
		queststatus = getPlayerStorageValue(cid,6076)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a  magic sword.")
   			doPlayerAddItem(cid,2400,1)
   			setPlayerStorageValue(cid,6076,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
   		end
   	elseif item.uid == 2002 then
		queststatus = getPlayerStorageValue(cid,6076)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a stonecutter axe.")
   			doPlayerAddItem(cid,2431,1)
   			setPlayerStorageValue(cid,6076,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
		end
   	elseif item.uid == 2003 then
		queststatus = getPlayerStorageValue(cid,6076)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a present.")
   			doPlayerAddItem(cid,1990,1)
   			setPlayerStorageValue(cid,6076,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
   		end
	end
   	return 1
end

In actions tooo -.-
 
Back
Top