• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Script errors

Elaney

Member
Joined
Jan 1, 2009
Messages
1,561
Reaction score
12
Location
Sweden
LUA:
local mobx = {

mob1 = {x=1122, y=958, z=7},
mob2 = {x=1130, y=958, z=7},
mob3 = {x=1126, y=956, z=7},
mob4 = {x=1126, y=963, z=7},
mob5 = {x=1126, y=959, z=7},
mob6 = {x=1126, y=960, z=7},
mob7 = {x=1126, y=962, z=7},
mob8 = {x=1126, y=955, z=7}
}

local room = { -- room with monsters
	fromX = 1119,
	fromY = 954,
	fromZ = 7,
	
	toX = 1135,
	toY = 963,
	toZ = 7
}



	function onStepIn(cid, item, pos)
	if item.uid == 14999 then
	if(item.itemid == 1387) then
		doSummoncreature("minotaur", mobx.mob1)
		doSummonCreature("minotaur", mobx.mob2)
		doSummonCreature("minotaur", mobx.mob3)
		doSummonCreature("minotaur", mobx.mob4)
		addEvent(mino1, 25 * 1000, p)
	elseif item.uid == 14999 then
	for x = room.fromX, room.toX do
	for y = room.fromY, room.toY do
	for z = room.fromZ, room.toZ do
	local pos = {x=x, y=y, z=z, stackpos = 253}
	local thing = getThingfromPos(pos)
		if thing.itemid > 0 then
		if isPlauer(thing.uid) == TRUE then
		player_room = player_room+1
					end 
				end
			end 
		end 
	end 
	if player_room >= 1 then 
	doPlayerSendTextMessage(cid,19,"there is already a player in the quest room.")
end 
	elseif player_room == 0 then 
	for x = room.fromX, room.toX do
	for y = room.fromY, room.toY do
	for z = room.fromZ, room.toZ do
	local pos = {x=x, y=y, z=z, stackpos = 253}
	local thing = getThingfromPos(pos)
	if thing.itemid > 0 then 
	doRemoveCreature(thing.uid)
				end 
			end
	return TRUE
end

Errors is

Code:
'end' expected <to close 'for' at line 51> near '<eof>'
 
Last edited:
Code:
local mobx {

mob1 = {x=1122, y=958, z=7},
mob2 = {x=1130, y=958, z=7},
mob3 = {x=1126, y=956, z=7},
mob4 = {x=1126, y=963, z=7},
mob5 = {x=1126, y=959, z=7},
mob6 = {x=1126, y=960, z=7},
mob7 = {x=1126, y=962, z=7},
mob8 = {x=1126, y=955, z=7}
}

shouldn't it be like this?

Code:
local mobx [COLOR="Red"]=[/COLOR] {

mob1 = {x=1122, y=958, z=7},
mob2 = {x=1130, y=958, z=7},
mob3 = {x=1126, y=956, z=7},
mob4 = {x=1126, y=963, z=7},
mob5 = {x=1126, y=959, z=7},
mob6 = {x=1126, y=960, z=7},
mob7 = {x=1126, y=962, z=7},
mob8 = {x=1126, y=955, z=7}
}
 
Code:
local mobx {

mob1 = {x=1122, y=958, z=7},
mob2 = {x=1130, y=958, z=7},
mob3 = {x=1126, y=956, z=7},
mob4 = {x=1126, y=963, z=7},
mob5 = {x=1126, y=959, z=7},
mob6 = {x=1126, y=960, z=7},
mob7 = {x=1126, y=962, z=7},
mob8 = {x=1126, y=955, z=7}
}

shouldn't it be like this?

Code:
local mobx [COLOR="Red"]=[/COLOR] {

mob1 = {x=1122, y=958, z=7},
mob2 = {x=1130, y=958, z=7},
mob3 = {x=1126, y=956, z=7},
mob4 = {x=1126, y=963, z=7},
mob5 = {x=1126, y=959, z=7},
mob6 = {x=1126, y=960, z=7},
mob7 = {x=1126, y=962, z=7},
mob8 = {x=1126, y=955, z=7}
}


ye i know. forgot to edit that one just :P tho i fixed that before the "real" error.
 
Code:
local mobx =  {
	mob1 = {x=1122, y=958, z=7},
	mob2 = {x=1130, y=958, z=7},
	mob3 = {x=1126, y=956, z=7},
	mob4 = {x=1126, y=963, z=7},
	mob5 = {x=1126, y=959, z=7},
	mob6 = {x=1126, y=960, z=7},
	mob7 = {x=1126, y=962, z=7},
	mob8 = {x=1126, y=955, z=7}
}

local room = { -- room with monsters
	fromX = 1119,
	fromY = 954,
	fromZ = 7,
       
	toX = 1135,
	toY = 963,
	toZ = 7
}



function onStepIn(cid, item, pos)
	if item.uid == 14999 then
		if(item.itemid == 1387) then
			doSummoncreature("minotaur", mobx.mob1)
			doSummonCreature("minotaur", mobx.mob2)
			doSummonCreature("minotaur", mobx.mob3)
			doSummonCreature("minotaur", mobx.mob4)
			addEvent(mino1, 25 * 1000, p)
		elseif item.uid == 14999 then
			for x = room.fromX, room.toX do
				for y = room.fromY, room.toY do
					for z = room.fromZ, room.toZ do
						local pos = {x=x, y=y, z=z, stackpos = 253}
						local thing = getThingfromPos(pos)
						if thing.itemid > 0 then
							if isPlauer(thing.uid) == TRUE then
								player_room = player_room+1
							end
						end
					end
				end
			end
			if player_room >= 1 then
				doPlayerSendTextMessage(cid,19,"there is already a player in the quest room.")
			end
		elseif player_room == 0 then
			for x = room.fromX, room.toX do
				for y = room.fromY, room.toY do
					for z = room.fromZ, room.toZ do
						local pos = {x=x, y=y, z=z, stackpos = 253}
						local thing = getThingfromPos(pos)
						if thing.itemid > 0 then
							doRemoveCreature(thing.uid)
						end
					end
				end
			end
		end
	end
return true
end
 
Back
Top