• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Anni script help

Zithium

Member
Joined
Mar 19, 2012
Messages
431
Reaction score
18
Hey. just wondering if anyone is bored enough and could add a function to check and remove any demons that are summoned into my anni script. would be greatly appreciated ^.^

Code:
-- annihilator lever

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

local critters = {
[1] = {x = 2191, y = 2116, z = 10, c = "Demon"},
[2] = {x = 2193, y = 2116, z = 10, c = "Demon"},
[3] = {x = 2192, y = 2120, z = 10, c = "Demon"},
[4] = {x = 2194, y = 2120, z = 10, c = "Demon"},
[5] = {x = 2189, y = 2118, z = 10, c = "Demon"},
[6] = {x = 2195, y = 2118, z = 10, c = "Demon"},
[7] = {x = 2196, y = 2118, z = 10, c = "Demon"}
}

   	if item.uid == 7000 and item.itemid == 1945 then
		player1pos = {x=2194, y=2118, z=9, stackpos=253}
		player1 = getThingfromPos(player1pos)

		player2pos = {x=2193, y=2118, z=9, stackpos=253}
		player2 = getThingfromPos(player2pos)

		player3pos = {x=2192, y=2118, z=9, stackpos=253}
		player3 = getThingfromPos(player3pos)

		player4pos = {x=2191, y=2118, z=9, 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=2194, y=2118, z=10}
				nplayer2pos = {x=2193, y=2118, z=10}
				nplayer3pos = {x=2192, y=2118, z=10}
				nplayer4pos = {x=2191, y=2118, z=10}

				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)
				
				for i = 1, table.maxn(critters) do
				doSummonCreature(critters[i].c, {x = critters[i].x, y = critters[i].y, z = critters[i].z})
			end

				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 ==7000 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

Thanks in advance =D



btw i'm using avesta 7.4 so I can't jus get a TFS script D=
 
Last edited:
Back
Top