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

Help me to script annihilator.

richux

Tibera.org
Joined
Aug 18, 2008
Messages
3,666
Reaction score
26
Location
---------
Hello! I have seached all around, but I couldn't make annihi for my ot that would work more than 1 time after restart. I tried like 10 other scripts, I even edited mine script, but something always isnt working after I do changes, cuz im messing it up Lol :( Im noob in scriptting, so thats why Im asking help. So, can someone edit this script so it would reset lever so quest can be done more than 1 time after restart. Im asking it cuz I know its not hard and does not take long time(at least, I think so).

This is the script that Im using atm:

Code:
-- player?pos = The position of the players before teleport.
-- player? = Get the thing from playerpos.
-- player?level = Get the players levels.
-- questslevel = The level you have to be to do this quest.
-- questtatus? = Get the quest status of the players.
-- demon?pos = The position of the demons.
-- nplayer?pos = The position where the players should be teleported too.
--
-- UniqueIDs used:
-- 10019 = The switch.

function onUse(cid, item, frompos, item2, topos)
	if item.uid == 10019 then
		if item.itemid == 1945 then

			player1pos = {x=1057, y=735, z=7, stackpos=253}
			player1 = getThingfromPos(player1pos)

			player2pos = {x=1056, y=735, z=7, stackpos=253}
			player2 = getThingfromPos(player2pos)

			player3pos = {x=1055, y=735, z=7, stackpos=253}
			player3 = getThingfromPos(player3pos)

			player4pos = {x=1054, y=735, z=7, stackpos=253}
			player4 = getThingfromPos(player4pos)


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

				player1level = getPlayerLevel(player1.uid)
				player2level = getPlayerLevel(player2.uid)
				player3level = getPlayerLevel(player3.uid)
				player4level = getPlayerLevel(player4.uid)

				questlevel = 100

				if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then

					queststatus1 = getPlayerStorageValue(player1.uid,10020)
					queststatus2 = getPlayerStorageValue(player2.uid,10020)
					queststatus3 = getPlayerStorageValue(player3.uid,10020)
					queststatus4 = getPlayerStorageValue(player4.uid,10020)

					if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
			
						demon1pos = {x=1058, y=735, z=8}
						demon2pos = {x=1059, y=735, z=8}
						demon3pos = {x=1055, y=733, z=8}
						demon4pos = {x=1057, y=733, z=8}
						demon5pos = {x=1054, y=737, z=8}
						demon6pos = {x=1056, y=737, z=8}
						 
						doSummonCreature("Demon", demon1pos)
						doSummonCreature("Demon", demon2pos)
						doSummonCreature("Demon", demon3pos)
						doSummonCreature("Demon", demon4pos)
						doSummonCreature("Demon", demon5pos)
						doSummonCreature("Demon", demon6pos)

						nplayer1pos = {x=1057, y=735, z=8}
						nplayer2pos = {x=1056, y=735, z=8}
						nplayer3pos = {x=1055, y=735, z=8}
						nplayer4pos = {x=1054, y=735, z=8}

						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,"Some one in your team has already done this quest.")
					end
				else
					doPlayerSendCancel(cid,"All players must be "..questlevel.." to do this quest.")
				end
			else
				doPlayerSendCancel(cid,"You need 4 players for this quest.")
			end
		elseif item.itemid == 1946 then
			if getPlayerAccess(cid) == 3 then
				doTransformItem(item.uid,item.itemid-1)
			else
				doPlayerSendCancel(cid,"Sorry, not possible.")
			end
		end
	end
	return 1
end

PS. You will not help only me, but all the players that are playing my ot will be happy cuz annihi will work :D
 
Code:
-- player?pos = The position of the players before teleport.
-- player? = Get the thing from playerpos.
-- player?level = Get the players levels.
-- questslevel = The level you have to be to do this quest.
-- questtatus? = Get the quest status of the players.
-- demon?pos = The position of the demons.
-- nplayer?pos = The position where the players should be teleported too.
--
-- UniqueIDs used:
-- 10019 = The switch.

function onUse(cid, item, frompos, item2, topos)
	if item.uid == 10019 then
		if item.itemid == 1945 then

			player1pos = {x=1057, y=735, z=7, stackpos=253}
			player1 = getThingfromPos(player1pos)

			player2pos = {x=1056, y=735, z=7, stackpos=253}
			player2 = getThingfromPos(player2pos)

			player3pos = {x=1055, y=735, z=7, stackpos=253}
			player3 = getThingfromPos(player3pos)

			player4pos = {x=1054, y=735, z=7, stackpos=253}
			player4 = getThingfromPos(player4pos)


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

				player1level = getPlayerLevel(player1.uid)
				player2level = getPlayerLevel(player2.uid)
				player3level = getPlayerLevel(player3.uid)
				player4level = getPlayerLevel(player4.uid)

				questlevel = 100

				if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then

					queststatus1 = getPlayerStorageValue(player1.uid,10020)
					queststatus2 = getPlayerStorageValue(player2.uid,10020)
					queststatus3 = getPlayerStorageValue(player3.uid,10020)
					queststatus4 = getPlayerStorageValue(player4.uid,10020)

					if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
			
						demon1pos = {x=1058, y=735, z=8}
						demon2pos = {x=1059, y=735, z=8}
						demon3pos = {x=1055, y=733, z=8}
						demon4pos = {x=1057, y=733, z=8}
						demon5pos = {x=1054, y=737, z=8}
						demon6pos = {x=1056, y=737, z=8}
						 
						doSummonCreature("Demon", demon1pos)
						doSummonCreature("Demon", demon2pos)
						doSummonCreature("Demon", demon3pos)
						doSummonCreature("Demon", demon4pos)
						doSummonCreature("Demon", demon5pos)
						doSummonCreature("Demon", demon6pos)

						nplayer1pos = {x=1057, y=735, z=8}
						nplayer2pos = {x=1056, y=735, z=8}
						nplayer3pos = {x=1055, y=735, z=8}
						nplayer4pos = {x=1054, y=735, z=8}

						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,"Some one in your team has already done this quest.")
					end
				else
					doPlayerSendCancel(cid,"All players must be "..questlevel.." to do this quest.")
				end
			else
				doPlayerSendCancel(cid,"You need 4 players for this quest.")
			end
			elseif item.itemid == 1946 then
				doTransformItem(item.uid,item.itemid-1)
			else
				doPlayerSendCancel(cid,"Sorry, not possible.")
			end
		end
	end
	return 1
end
 
Actualy I Didn't see something different in your script. But now I got following error:

Code:
 Warning: [Event::loadScript] Can not load script. data/actions/scripts/quests/Annihilator.lua
[19/02/2009 19:29:53] data/actions/scripts/quests/Annihilator.lua:101: '<eof>' expected near 'end'
 
sorry :(

PHP:
-- player?pos = The position of the players before teleport.
-- player? = Get the thing from playerpos.
-- player?level = Get the players levels.
-- questslevel = The level you have to be to do this quest.
-- questtatus? = Get the quest status of the players.
-- demon?pos = The position of the demons.
-- nplayer?pos = The position where the players should be teleported too.
--
-- UniqueIDs used:
-- 10019 = The switch.

function onUse(cid, item, frompos, item2, topos)
	if item.uid == 10019 then
		if item.itemid == 1945 then

			player1pos = {x=1057, y=735, z=7, stackpos=253}
			player1 = getThingfromPos(player1pos)

			player2pos = {x=1056, y=735, z=7, stackpos=253}
			player2 = getThingfromPos(player2pos)

			player3pos = {x=1055, y=735, z=7, stackpos=253}
			player3 = getThingfromPos(player3pos)

			player4pos = {x=1054, y=735, z=7, stackpos=253}
			player4 = getThingfromPos(player4pos)


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

				player1level = getPlayerLevel(player1.uid)
				player2level = getPlayerLevel(player2.uid)
				player3level = getPlayerLevel(player3.uid)
				player4level = getPlayerLevel(player4.uid)

				questlevel = 100

				if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then

					queststatus1 = getPlayerStorageValue(player1.uid,10020)
					queststatus2 = getPlayerStorageValue(player2.uid,10020)
					queststatus3 = getPlayerStorageValue(player3.uid,10020)
					queststatus4 = getPlayerStorageValue(player4.uid,10020)

					if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
			
						demon1pos = {x=1058, y=735, z=8}
						demon2pos = {x=1059, y=735, z=8}
						demon3pos = {x=1055, y=733, z=8}
						demon4pos = {x=1057, y=733, z=8}
						demon5pos = {x=1054, y=737, z=8}
						demon6pos = {x=1056, y=737, z=8}
						 
						doSummonCreature("Demon", demon1pos)
						doSummonCreature("Demon", demon2pos)
						doSummonCreature("Demon", demon3pos)
						doSummonCreature("Demon", demon4pos)
						doSummonCreature("Demon", demon5pos)
						doSummonCreature("Demon", demon6pos)

						nplayer1pos = {x=1057, y=735, z=8}
						nplayer2pos = {x=1056, y=735, z=8}
						nplayer3pos = {x=1055, y=735, z=8}
						nplayer4pos = {x=1054, y=735, z=8}

						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,"Some one in your team has already done this quest.")
					end
				else
					doPlayerSendCancel(cid,"All players must be "..questlevel.." to do this quest.")
				end
			else
				doPlayerSendCancel(cid,"You need 4 players for this quest.")
			elseif item.itemid == 1946 then
				doTransformItem(item.uid,item.itemid-1)
			else
				doPlayerSendCancel(cid,"Sorry, not possible.")
			end
		end
	end
	return 1
end
 
@up

SRy man, but still not working:

Code:
Warning: [Event::loadScript] Can not load script. data/actions/scripts/quests/Annihilator.lua
[19/02/2009 21:04:23] data/actions/scripts/quests/Annihilator.lua:92: 'end' expected (to close 'if' at line 29) near 'elseif'

Can you fix it? :p
 
PHP:
-- player?pos = The position of the players before teleport.
-- player? = Get the thing from playerpos.
-- player?level = Get the players levels.
-- questslevel = The level you have to be to do this quest.
-- questtatus? = Get the quest status of the players.
-- demon?pos = The position of the demons.
-- nplayer?pos = The position where the players should be teleported too.
--
-- UniqueIDs used:
-- 10019 = The switch.

function onUse(cid, item, frompos, item2, topos)
    if item.uid == 10019 then
        if item.itemid == 1945 then

            player1pos = {x=1057, y=735, z=7, stackpos=253}
            player1 = getThingfromPos(player1pos)

            player2pos = {x=1056, y=735, z=7, stackpos=253}
            player2 = getThingfromPos(player2pos)

            player3pos = {x=1055, y=735, z=7, stackpos=253}
            player3 = getThingfromPos(player3pos)

            player4pos = {x=1054, y=735, z=7, stackpos=253}
            player4 = getThingfromPos(player4pos)


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

                player1level = getPlayerLevel(player1.uid)
                player2level = getPlayerLevel(player2.uid)
                player3level = getPlayerLevel(player3.uid)
                player4level = getPlayerLevel(player4.uid)

                questlevel = 100

                if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then

                    queststatus1 = getPlayerStorageValue(player1.uid,10020)
                    queststatus2 = getPlayerStorageValue(player2.uid,10020)
                    queststatus3 = getPlayerStorageValue(player3.uid,10020)
                    queststatus4 = getPlayerStorageValue(player4.uid,10020)

                    if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
            
                        demon1pos = {x=1058, y=735, z=8}
                        demon2pos = {x=1059, y=735, z=8}
                        demon3pos = {x=1055, y=733, z=8}
                        demon4pos = {x=1057, y=733, z=8}
                        demon5pos = {x=1054, y=737, z=8}
                        demon6pos = {x=1056, y=737, z=8}
                         
                        doSummonCreature("Demon", demon1pos)
                        doSummonCreature("Demon", demon2pos)
                        doSummonCreature("Demon", demon3pos)
                        doSummonCreature("Demon", demon4pos)
                        doSummonCreature("Demon", demon5pos)
                        doSummonCreature("Demon", demon6pos)

                        nplayer1pos = {x=1057, y=735, z=8}
                        nplayer2pos = {x=1056, y=735, z=8}
                        nplayer3pos = {x=1055, y=735, z=8}
                        nplayer4pos = {x=1054, y=735, z=8}

                        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,"Some one in your team has already done this quest.")
                    end
                else
                    doPlayerSendCancel(cid,"All players must be "..questlevel.." to do this quest.")
                end
            else
                doPlayerSendCancel(cid,"You need 4 players for this quest.")
            end
        elseif item.itemid == 1946 then
                doTransformItem(item.uid,item.itemid-1)
        else
               doPlayerSendCancel(cid,"Sorry, not possible.")
        end
    end
    return 1
end

Sorry being so dumb today :(
 
Back
Top