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

Problems with anhilator

mcccp

New Member
Joined
Apr 11, 2009
Messages
23
Reaction score
0
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
for i = 1, 4 do
player = getThingfromPos(playerPosition)


error - [11/05/2009 12:58:52] Lua Script Error: [Action Interface]
[11/05/2009 12:58:52] data/actions/scripts/quests/annihilator.lua:onUse

[11/05/2009 12:58:52] luaGetThingFromPos(). Tile not found

any help please? :)
 
could you post the whole scripts please?
or try this one:
Code:
function onUse(cid, item, frompos, item2, topos)
   	-- annihilator
   	if item.uid == 5000 then
   		if item.itemid == 1945 or 1946 or 1947 then
 
   			player1pos = {x=1008, y=1008, z=7, stackpos=253}
   			player1 = getThingfromPos(player1pos)
 
   			player2pos = {x=1007, y=1008, z=7, stackpos=253}
   			player2 = getThingfromPos(player2pos)
 
   			player3pos = {x=1006, y=1008, z=7, stackpos=253}
   			player3 = getThingfromPos(player3pos)

   			player4pos = {x=1005, y=1008, 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(player3.uid)
 
   				questlevel = 100
 
   				if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then
 
   					queststatus1 = getPlayerStorageValue(player1.uid,110)
   					queststatus2 = getPlayerStorageValue(player2.uid,110)
   					queststatus3 = getPlayerStorageValue(player3.uid,110)
   					queststatus4 = getPlayerStorageValue(player4.uid,110)
 
   					if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
 
   						nplayer1pos = {x=1015, y=990, z=7}
   						nplayer2pos = {x=1014, y=990, z=7}
   						nplayer3pos = {x=1013, y=990, z=7}
			            	nplayer4pos = {x=1012, y=990, z=7}
 
   						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,nplayer3pos)
 
   						doSendMagicEffect(nplayer1pos,10)
   						doSendMagicEffect(nplayer2pos,10)
   						doSendMagicEffect(nplayer3pos,10)
   						doSendMagicEffect(nplayer4pos,10)
 
 
   					else
   						doPlayerSendCancel(cid,"Somebody in your team has already done this quest.")
   					end
   				else
   					doPlayerSendCancel(cid,"All players must have level 100 to enter.")
   				end
   			else
   				doPlayerSendCancel(cid,"You need 4 players in your team.")
   			end
   		end
 
   	end
   return 1
   end
 
Code:
local playerPosition =
{
	{x = 247, y = 659, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 247, y = 660, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 247, y = 661, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 247, y = 662, z = 13, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
	{x = 189, y = 650, z = 13},
 	{x = 189, y = 651, z = 13},
	{x = 189, y = 652, z = 13},
	{x = 189, y = 653, z = 13}
}

-- Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = FALSE

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		for i = 1, 4 do
			failed = TRUE
			player[i] = getThingfromPos(playerPosition[i])
			if player[i].itemid > 0 then
				if isPlayer(player[i].uid) == TRUE then
					if getPlayerStorageValue(player[i].uid, 30015) == -1 then
						if getPlayerLevel(player[i].uid) >= 100 then
							failed = FALSE
						end
					end
				end
			end
			if failed == TRUE then
				doPlayerSendCancel(cid, "Sorry, not possible.")
				return TRUE
			end
		end
		for i = 1, 4 do
			doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
			doTeleportThing(player[i].uid, newPosition[i], FALSE)
			doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
		end
		doTransformItem(item.uid, item.itemid + 1)
	elseif item.itemid == 1946 then
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	return TRUE
end



Try this one here.
Dont forget to change the coordinates :D
 
Back
Top