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

Some can fix this script?

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
Here the error

Code:
[05/07/2010 17:53:30] [Error - GlobalEvent Interface] 
[05/07/2010 17:53:30] In a timer event called from: 
[05/07/2010 17:53:30] data/globalevents/scripts/event.lua:onThink
[05/07/2010 17:53:30] Description: 
[05/07/2010 17:53:30] (luaDoRemoveItem) Item not found

Here script

Code:
local timeToCreate = 1 -- minutes
local walls = {
	{ x = 417, y = 65, z = 7, stackpos = STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE },
	{ x = 417, y = 67, z = 7, stackpos = STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE }
}

function removeWalls(item, position)
	doBroadcastMessage("Somente para jogadores experientes.")
	addEvent(createWalls, timeToCreate * 100000000)
	for i = 1, table.maxn(walls) do
		doRemoveItem(getThingfromPos(walls[i]).uid)
		doSendMagicEffect(walls[i], CONST_ME_MAGIC_RED)
	end
	return TRUE
end

function createWalls(item, position)
	for i = 1,table.maxn(walls) do
		doCreateItem(9485, 1, walls[i])
		doSendMagicEffect(walls[i], CONST_ME_MAGIC_GREEN)
	end
	return TRUE
end

function onThink(interval, lastExecution)
	doBroadcastMessage("Blood castle aberto!.")
	addEvent(removeWalls, 1000)
	return TRUE
end

Im REP++
 
try changing table.maxn(walls) to #walls, so it will loop though the arrays:
Code:
for i = 1, #walls do
do the same for the createWalls function
 
Back
Top