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

Help with Annihilator Script...

nawelter

New Member
Joined
May 29, 2009
Messages
6
Reaction score
0
Players are able to loot all four items after they complete the quest. Could someone give me a little help please? Here's my code:

Code:
-- annihilator lever

local config = {
	monster = "Annihilator Demon",
	positions = {
		{x=525, y=768, z=14}, {x=527, y=768, z=14}, {x=529, y=770, z=14},
		{x=530, y=770, z=14}, {x=528, y=772, z=14}, {x=526, y=772, z=14}
	}
}
function onUse(cid, item, frompos, item2, topos)
    local dzwignia = os.clock()
    if item.uid == 7000 and item.itemid == 1945 then
		local player1pos = {x=525, y=770, z=12, stackpos=253}
		local player1 = getThingfromPos(player1pos)
		local player2pos = {x=526, y=770, z=12, stackpos=253}
		local player2 = getThingfromPos(player2pos)
		local player3pos = {x=527, y=770, z=12, stackpos=253}
		local player3 = getThingfromPos(player3pos)
		local player4pos = {x=528, y=770, z=12, stackpos=253}
		local player4 = getThingfromPos(player4pos)
        if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
            local queststatus1 = getPlayerStorageValue(player1.uid,7000)
            local queststatus2 = getPlayerStorageValue(player2.uid,7000)
            local queststatus3 = getPlayerStorageValue(player3.uid,7000)
            local queststatus4 = getPlayerStorageValue(player4.uid,7000)
            if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
                local nplayer1pos = {x=525, y=770, z=14}
                local nplayer2pos = {x=526, y=770, z=14}
                local nplayer3pos = {x=527, y=770, z=14}
                local nplayer4pos = {x=528, y=770, z=14}
                doSendMagicEffect(player1pos,2)
                doSendMagicEffect(player2pos,2)
                doSendMagicEffect(player3pos,2)
                doSendMagicEffect(player4pos,2)
				for i = 1, table.maxn(config.positions) do
					doSummonCreature(config.monster, config.positions[i])
				end
                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,"Alguem no seu time jah fez a quest.")
            end
        else
            doPlayerSendCancel(cid,"You need 4 players to do Annihilator.")
        end

    elseif item.uid ==7000 and item.itemid == 1946 then
        if (dzwignia - os.clock()) > 60 then
			doTransformItem(item.uid,item.itemid-1)
        end
        if getPlayerAccess(cid) > 0 then
            doTransformItem(item.uid,item.itemid-1)
            end
       	elseif item.uid == 5001 then
	    
	        queststatus = getPlayerStorageValue(cid,7000)
	    
	        if queststatus == -1 then
	          doPlayerSendTextMessage(cid,24,"You have chosen the Skullcracker Armor.")
	          doPlayerAddItem(cid,8889,1)
	          setPlayerStorageValue(cid,7000,1)
	        else
	          doPlayerSendTextMessage(cid,22,"The chest is empty.")
	        end
	      elseif item.uid == 5002 then
	    
	        queststatus = getPlayerStorageValue(cid,7000)
	    
	        if queststatus == -1 then
	          doPlayerSendTextMessage(cid,24,"You have chosen the Spirit Cloak.")
	          doPlayerAddItem(cid,8870,1)
	          setPlayerStorageValue(cid,7000,1)
	        else
	          doPlayerSendTextMessage(cid,22,"The chest is empty.")
	        end
	      elseif item.uid == 5003 then
	    
	        queststatus = getPlayerStorageValue(cid,7000)
	    
	        if queststatus == -1 then
	          doPlayerSendTextMessage(cid,24,"You have chosen the Master Archer's Armor.")
	          doPlayerAddItem(cid,8888,1)
	          setPlayerStorageValue(cid,7000,1)
	        else
	          doPlayerSendTextMessage(cid,22,"The chest is empty.")
	        end
	      elseif item.uid == 5004 then
	    
	        queststatus = getPlayerStorageValue(cid,7000)
	       	    
	       	        if queststatus == -1 then
	       	          doPlayerSendTextMessage(cid,24,"You have chosen the Robe of the Underworld.")
	       	          doPlayerAddItem(cid,8890,1)
	       	          setPlayerStorageValue(cid,7000,1)
	       	        else
	       	          doPlayerSendTextMessage(cid,22,"The chest is empty.")
	        end
        end
    return TRUE
end
 
change:
Lua:
	    elseif item.uid == 5001 then
    
	        queststatus = getPlayerStorageValue(cid,7001)
	    
	        if queststatus == -1 then
	            doPlayerSendTextMessage(cid,24,"You have chosen the Skullcracker Armor.")
	            doPlayerAddItem(cid,8889,1)
	            setPlayerStorageValue(cid,7001,1)
	        else
	            doPlayerSendTextMessage(cid,22,"The chest is empty.")
	        end
	    elseif item.uid == 5002 then
	    
	        queststatus = getPlayerStorageValue(cid,7002)
	    
	        if queststatus == -1 then
	            doPlayerSendTextMessage(cid,24,"You have chosen the Spirit Cloak.")
	            doPlayerAddItem(cid,8870,1)
	            setPlayerStorageValue(cid,7002,1)
	        else
	            doPlayerSendTextMessage(cid,22,"The chest is empty.")
	        end
	    elseif item.uid == 5003 then
	    
	        queststatus = getPlayerStorageValue(cid,7003)
	    
	        if queststatus == -1 then
	            doPlayerSendTextMessage(cid,24,"You have chosen the Master Archer's Armor.")
	            doPlayerAddItem(cid,8888,1)
	            setPlayerStorageValue(cid,7003,1)
	        else
	            doPlayerSendTextMessage(cid,22,"The chest is empty.")
	        end
	    elseif item.uid == 5004 then
	    
	        queststatus = getPlayerStorageValue(cid,7004)
	       	    
	       	if queststatus == -1 then
	       	    doPlayerSendTextMessage(cid,24,"You have chosen the Robe of the Underworld.")
	       	    doPlayerAddItem(cid,8890,1)
	       	    setPlayerStorageValue(cid,7004,1)
	       	else
	       	    doPlayerSendTextMessage(cid,22,"The chest is empty.")
	        end
           end
     return TRUE
end
 
I think he wants it so that they cant get every item.

You can put queststatus = getPlayerStorageValue(cid, 7000) before it all though to reduce the size.
 
Back
Top