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

Solved Just a fast fix script HELP please

Bladefist

New Member
Joined
Oct 26, 2010
Messages
65
Reaction score
0
Location
Carlin
Code:
-- scythelever

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

   	if item.uid == 9020 and item.itemid == 1945 then
		player1pos = {x=1172, y=1095, z=9, stackpos=253}
		player1 = getThingfromPos(player1pos)

		player2pos = {x=1174, y=1095, z=9, stackpos=253}
		player2 = getThingfromPos(player2pos)


		if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
			queststatus1 = getPlayerStorageValue(player1.uid,9020)
			queststatus2 = getPlayerStorageValue(player2.uid,9020)

			if queststatus1 == -1 and queststatus2 == -1 then
				nplayer1pos = {x=1172, y=1086, z=9}
				nplayer2pos = {x=1174, y=1086, z=9}


				doSendMagicEffect(player1pos,2)
				doSendMagicEffect(player2pos,2)


				doTeleportThing(player1.uid,nplayer1pos)
				doTeleportThing(player2.uid,nplayer2pos)


				doSendMagicEffect(nplayer1pos,10)
				doSendMagicEffect(nplayer2pos,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 two players for this quest.")
		end

	elseif item.uid ==9020 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

Everytime I try to edit a Annilever script into a 2man version I fail.

Wheres the problem? hehe
 
Last edited:
Code:
-- annihilator lever

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

   	if item.uid == 9000 and item.itemid == 1945 then
		player1pos = {x=1133, y=1242, z=10, stackpos=253}
		player1 = getThingfromPos(player1pos)

		player2pos = {x=1132, y=1242, z=10, stackpos=253}
		player2 = getThingfromPos(player2pos)

		player3pos = {x=1131, y=1242, z=10, stackpos=253}
		player3 = getThingfromPos(player3pos)

		player4pos = {x=1130, y=1242, z=10, 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,3333)
			queststatus2 = getPlayerStorageValue(player2.uid,3333)
			queststatus3 = getPlayerStorageValue(player3.uid,3333)
			queststatus4 = getPlayerStorageValue(player4.uid,3333)

			if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
				nplayer1pos = {x=1133, y=1242, z=11}
				nplayer2pos = {x=1132, y=1242, z=11}
				nplayer3pos = {x=1131, y=1242, z=11}
				nplayer4pos = {x=1130, y=1242, 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 ==9000 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


Heres a working 4 ppl Annilever script, can anyone make it for 2 ppls then?..

Giving REP is NO problem, 1 click you know :)
 
whats wrong in the script is
Code:
if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then

change to

Code:
if player1.itemid > 0 and player2.itemid > 0 then
 
Try this:
Lua:
-- scythelever
local config = {
	pos = {{x=1172, y=1095, z=9, stackpos=253}, {x=1174, y=1095, z=9, stackpos=253}},
	new = {{x=1172, y=1086, z=9}, {x=1174, y=1086, z=9}},
	once = true,
	storage = 9020
}

function onUse(cid, item, frompos, item2, topos)
	if item.itemid == 1946 then
		return (getPlayerAccess(cid) >= 3 or not(config.once)) and doTransformItem(item.uid,item.itemid-1) or doPlayerSendCancel(cid,"Sorry, not possible.")
   	end
	
	local players, done = {}, false
	
	for _, position in next, players do
		local thing = getThingFromPos(position)
		if isPlayer(thing.uid) then
			table.insert(players, thing.uid)
			if getPlayerStorageValue(thing.uid, config.storage) ~= -1 then
				done = true
			end
		end
	end
	
	if done then
		return doPlayerSendCancel(cid,"Someone in your team already did this quest.")
	end
	
	if #players < #config.pos then
		return doPlayerSendCancel(cid,"You need two players for this quest.")
	end

	for i = 1, #players do
		doSendMagicEffect(getThingPos(players[i]), CONST_ME_POFF)
		doTeleportThing(players[i], config.new[i])
		doSendMagicEffect(getThingPos(players[i]), CONST_ME_TELEPORT)
	end
	
	doTransformItem(item.uid,item.itemid+1)
	return true
end
 
Back
Top