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

Lua AnniLaver

Zool

Banned User
Joined
Jun 9, 2009
Messages
742
Reaction score
5
Location
Poland/St Wola
Code:
-- annihilator lever



function onUse(cid, item, frompos, item2, topos)



   	if item.uid == 4353 and item.itemid == 1945 then

		player1pos = {x=1450, y=1575, z=11, stackpos=253}

		player1 = getThingfromPos(player1pos)



		player2pos = {x=1449, y=1575, z=11, stackpos=253}

		player2 = getThingfromPos(player2pos)



		player3pos = {x=1448, y=1575, z=11, stackpos=253}

		player3 = getThingfromPos(player3pos)



		player4pos = {x=1447, y=1575, z=11, stackpos=253}

		player4 = getThingfromPos(player4pos)





		if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then

			queststatus1 = getPlayerStorageValue(player1.uid,7000)

			queststatus2 = getPlayerStorageValue(player2.uid,7000)

			queststatus3 = getPlayerStorageValue(player3.uid,7000)

			queststatus4 = getPlayerStorageValue(player4.uid,7000)



			if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then

				nplayer1pos = {x=1475, y=1575, z=11}

				nplayer2pos = {x=1474, y=1575, z=11}

				nplayer3pos = {x=1473, y=1575, z=11}

				nplayer4pos = {x=1472, y=1575, z=11}



				doSendMagicEffect(player1pos,2)

				doSendMagicEffect(player2pos,2)

				doSendMagicEffect(player3pos,2)

				doSendMagicEffect(player4pos,2)



				doTeleportThing(player1.uid,nplayer1pos)

				doTeleportThing(player2.uid,nplayer2pos)

				doTeleportThing(player3.uid,nplayer3pos)

				doTeleportThing(player4.uid,nplayer4pos)



				doSendMagicEffect(nplayer1pos,10)

				doSendMagicEffect(nplayer2pos,10)

				doSendMagicEffect(nplayer3pos,10)

				doSendMagicEffect(nplayer4pos,10)



				doTransformItem(item.uid,item.itemid+1)

			else

				doPlayerSendCancel(cid,"Somebody in your team has already done this quest.")

			end

		else

			doPlayerSendCancel(cid,"You need four players for this quest.")

		end



	elseif item.uid ==4353 and item.itemid == 1946 then

		if getPlayerAccess(cid) > 0 then

			doTransformItem(item.uid,item.itemid-1)

		else

			doPlayerSendCancel(cid,"Sorry, not possible.")

		end

	else

		return 0

	end



	return 1

end

were change to players can make more time on day ?
 
try this
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local playerPosition = {
	{x = 1450, y = 1575, z = 11},
	{x = 1449, y = 1575, z = 11},
	{x = 1448, y = 1575, z = 11},
	{x = 1447, y = 1575, z = 11}
}
local newPosition = {
	{x = 1475, y = 1575, z = 11},
	{x = 1474, y = 1575, z = 11},
	{x = 1473, y = 1575, z = 11},
	{x = 1472, y = 1575, z = 11}
}
local players = {]
	for _, pos in ipairs(playerPosition) do
		local player = getTopCreature(pos).uid
		if player > 0 and isPlayer(player) then
			table.insert(players, player)
		end
	end
	if item.itemid == 1945 or item.itemid == 1946 then
		for i, k in ipairs(players) do
			if k == 4 then
				doSendMagicEffect(getThingPos(k), CONST_ME_POFF)
				doTeleportThing(k, newPosition[i])
				doSendMagicEffect(newPosition[i], CONST_ME_TELEPORT)
			end
		end
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
try this:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local playerPosition = {
	{x = 1450, y = 1575, z = 11},
	{x = 1449, y = 1575, z = 11},
	{x = 1448, y = 1575, z = 11},
	{x = 1447, y = 1575, z = 11}
}
local newPosition = {
	{x = 1475, y = 1575, z = 11},
	{x = 1474, y = 1575, z = 11},
	{x = 1473, y = 1575, z = 11},
	{x = 1472, y = 1575, z = 11}
}
local players = {]
	for _, pos in ipairs(playerPosition) do
		local player = getTopCreature(pos).uid
		if player > 0 and isPlayer(player) then
			table.insert(players, player)
		end
	end
	if item.itemid == 1945 or item.itemid == 1946 then
		for i, k in ipairs(players) do
			for _, position in ipairs(newPosition) do
				if k == 4 then
					doSendMagicEffect(getThingPos(k), CONST_ME_POFF)
					doTeleportThing(k, position, true)
					doSendMagicEffect(position, CONST_ME_TELEPORT)
				end
			end
		end
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Back
Top