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

Bomberman HELP

White Rabbit

sereniaot.org
Joined
Apr 12, 2009
Messages
239
Reaction score
11
Location
Sweden
Code:
[14:58:12.343] [Error - TalkAction Interface]
[14:58:12.344] In a timer event called from:
[14:58:12.346] data/talkactions/scripts/bomb.lua:onSay
[14:58:12.347] Description:
[14:58:12.347] (luaGetCreatureName) Creature not found

[14:58:12.347] [Error - TalkAction Interface]
[14:58:12.347] In a timer event called from:
[14:58:12.348] data/talkactions/scripts/bomb.lua:onSay
[14:58:12.348] Description:
[14:58:12.348] data/talkactions/scripts/bomb.lua:102: attempt to concatenate a boolean value
[14:58:12.348] stack traceback:
[14:58:12.348]  data/talkactions/scripts/bomb.lua:102: in function <data/talkactions/scripts/bomb.lua:87>


Code:
function getPlayersInRange(position, radiusx, radiusy)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z})
				if creature.type == 1 then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if creature.type == 1 then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end

function isPositionInArray(haystack, needle)
	for i = 1, #haystack do
		if haystack[i].x == needle.x and haystack[i].y == needle.y and haystack[i].z == needle.z then
			return true
		end
	end
	return false
end

local t = {
	from = {x=1306, y=1226, z=7},
	to = {x=1320, y=1236, z=7},
	storage = {
		placed = 10001,
		max = 10002,
		radius = 10003
	},
	delay = 3000,
	bombID = 10570,
	effect = CONST_ME_FIREAREA,
	blockID = 9421,
	text = "BOOM!",
	temple = {x=1218, y=1042, z=7},
	exceptions = {
		{x=1308, y=1227, z=7},
		{x=1307, y=1226, z=7},
		{x=1306, y=1227, z=7},
		
		{x=1320, y=1226, z=7},
		{x=1319, y=1226, z=7},
		{x=1320, y=1227, z=7},
		
		{x=1306, y=1236, z=7},
		{x=1306, y=1235, z=7},
		{x=1307, y=1236, z=7},
		
		{x=1320, y=1236, z=7},
		{x=1320, y=1235, z=7},
		{x=1319, y=1236, z=7}
	}
}
function reset()
	local dummy = doCreateItem(10570, 1, {x=1006,y=1098,z=12})
	for x = t.from.x, t.to.x do
		for y = t.from.y, t.to.y do
			local pos = {x=x,y=y,z=t.from.z}
			local i1, i2, i3  = getTileItemById(pos, 8304).uid, getTileItemById(pos, 8306).uid, getTileItemById(pos, 8310).uid
			if i1 > 0 then
				doRemoveItem(i1)
			end
			if i2 > 0 then
				doRemoveItem(i2)
			end
			if i3 > 0 then
				doRemoveItem(i3)
			end
			if queryTileAddThing(dummy, pos, 4) == RETURNVALUE_NOERROR and not isPositionInArray(t.exceptions, pos) then
				doCreateItem(t.blockID, 1, pos)
			end
		end
	end
	doRemoveItem(dummy)
end

local function boom(pos, cid)
	local v = getTileItemById(pos, t.bombID).uid
	if isPlayer(cid) and isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) - 1)
		doCreatureSay(cid, t.text, TALKTYPE_ORANGE_2, false, nil, pos)
		doSendMagicEffect(pos, t.effect)
		local c = getTopCreature(pos).uid
		if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
			doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
			doTeleportThing(c, t.temple)
			doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
			local n1, n2 = getPlayerName(c), getPlayerName(cid)
			doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
			local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
			if #a < 2 then
				doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
				doPlayerAddLevel(a[1], 1)
				doTeleportThing(a[1], t.temple)
				doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
				reset()
				reset()
			end
		else
			local b = getTileItemById(pos, t.blockID).uid
			if b > 0 then
				doSendMagicEffect(pos, CONST_ME_BLOCKHIT)
				doRemoveItem(b)
				local r = math.random(10)
				if r < 4 then
					doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
				end
			end
		end
		local N, E, W, S, l = 1, 1, 1, 1, getPlayerStorageValue(cid, t.storage.radius)
		function loopDir(dir)
			local _pos = {x=pos.x+(dir=="E" and E or dir=="W" and -W or 0), y=pos.y+(dir=="N" and -N or dir=="S" and S or 0), z=pos.z}
			if queryTileAddThing(v, _pos, 4) == RETURNVALUE_NOERROR or getTileItemById(_pos, t.blockID).uid > 0 then
				doSendMagicEffect(_pos, t.effect)
				local c = getTopCreature(_pos).uid
				if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
					doSendMagicEffect(_pos, CONST_ME_GIFT_WRAPS)
					doTeleportThing(c, t.temple)
					doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
					local n1, n2 = getPlayerName(c), getPlayerName(cid)
					doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
					local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
					if #a < 2 then
						doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
						doPlayerAddLevel(a[1], 1)
						doTeleportThing(a[1], t.temple)
						doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
						reset()
						reset()
						return "endgame"
					end
				else
					local b = getTileItemById(_pos, t.blockID).uid
					if b > 0 then
						doSendMagicEffect(_pos, CONST_ME_BLOCKHIT)
						doRemoveItem(b)
						local r = math.random(10)
						if r < 4 then
							doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
						end
						return false
					end
				end
			elseif queryTileAddThing(v, _pos, 4) == 3 then
				return false
			end
			return true
		end
		while N <= l do
			local q = loopDir("N")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				N = N + 1
			end
		end
		while E <= l do
			local q = loopDir("E")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				E = E + 1
			end
		end
		while W <= l do
			local q = loopDir("W")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				W = W + 1
			end
		end
		while S <= l do
			local q = loopDir("S")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				S = S + 1
			end
		end
	end
	doRemoveItem(v, 1)
end
function onSay(cid, words, param, channel)
	if isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, math.max(getPlayerStorageValue(cid, t.storage.placed), 0))
		setPlayerStorageValue(cid, t.storage.max, math.max(getPlayerStorageValue(cid, t.storage.max), 1))
		setPlayerStorageValue(cid, t.storage.radius, math.max(getPlayerStorageValue(cid, t.storage.radius), 1))
		if getPlayerStorageValue(cid, t.storage.placed) < getPlayerStorageValue(cid, t.storage.max) then
			doCreateItem(t.bombID, 1, getThingPos(cid))
			addEvent(boom, t.delay, getThingPos(cid), cid)
			setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) + 1)
		end
		return true
	end
end
 
hmm try if work
PHP:
function getPlayersInRange(position, radiusx, radiusy)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z})
				if creature.type == 1 then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if creature.type == 1 then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end

function isPositionInArray(haystack, needle)
	for i = 1, #haystack do
		if haystack[i].x == needle.x and haystack[i].y == needle.y and haystack[i].z == needle.z then
			return true
		end
	end
	return false
end

local t = {
	from = {x=1306, y=1226, z=7},
	to = {x=1320, y=1236, z=7},
	storage = {
		placed = 10001,
		max = 10002,
		radius = 10003
	},
	delay = 3000,
	bombID = 10570,
	effect = CONST_ME_FIREAREA,
	blockID = 9421,
	text = "BOOM!",
	temple = {x=1218, y=1042, z=7},
	exceptions = {
		{x=1308, y=1227, z=7},
		{x=1307, y=1226, z=7},
		{x=1306, y=1227, z=7},
		
		{x=1320, y=1226, z=7},
		{x=1319, y=1226, z=7},
		{x=1320, y=1227, z=7},
		
		{x=1306, y=1236, z=7},
		{x=1306, y=1235, z=7},
		{x=1307, y=1236, z=7},
		
		{x=1320, y=1236, z=7},
		{x=1320, y=1235, z=7},
		{x=1319, y=1236, z=7}
	}
}
function reset()
	local dummy = doCreateItem(10570, 1, {x=1006,y=1098,z=12})
	for x = t.from.x, t.to.x do
		for y = t.from.y, t.to.y do
			local pos = {x=x,y=y,z=t.from.z}
			local i1, i2, i3  = getTileItemById(pos, 8304).uid, getTileItemById(pos, 8306).uid, getTileItemById(pos, 8310).uid
			if i1 > 0 then
				doRemoveItem(i1)
			end
			if i2 > 0 then
				doRemoveItem(i2)
			end
			if i3 > 0 then
				doRemoveItem(i3)
			end
			if queryTileAddThing(dummy, pos, 4) == RETURNVALUE_NOERROR and not isPositionInArray(t.exceptions, pos) then
				doCreateItem(t.blockID, 1, pos)
			end
		end
	end
	doRemoveItem(dummy)
end

local function boom(pos, cid)
	local v = getTileItemById(pos, t.bombID).uid
	if isPlayer(cid) and isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) - 1)
		doCreatureSay(cid, t.text, TALKTYPE_ORANGE_2, false, nil, pos)
		doSendMagicEffect(pos, t.effect)
		local c = getTopCreature(pos).uid
		if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
			doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
			doTeleportThing(c, t.temple)
			doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
			local n1, n2 = getPlayerName(c), getPlayerName(cid)
			doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
			local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
			if #a < 2 then
			doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
				doPlayerAddLevel(a[1], 1)
				doTeleportThing(a[1], t.temple)
				doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
				reset()
				reset()
			end
		else
			local b = getTileItemById(pos, t.blockID).uid
			if b > 0 then
				doSendMagicEffect(pos, CONST_ME_BLOCKHIT)
				doRemoveItem(b)
				local r = math.random(10)
				if r < 4 then
					doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
				end
			end
		end
		local N, E, W, S, l = 1, 1, 1, 1, getPlayerStorageValue(cid, t.storage.radius)
		function loopDir(dir)
			local _pos = {x=pos.x+(dir=="E" and E or dir=="W" and -W or 0), y=pos.y+(dir=="N" and -N or dir=="S" and S or 0), z=pos.z}
			if queryTileAddThing(v, _pos, 4) == RETURNVALUE_NOERROR or getTileItemById(_pos, t.blockID).uid > 0 then
				doSendMagicEffect(_pos, t.effect)
				local c = getTopCreature(_pos).uid
				if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
					doSendMagicEffect(_pos, CONST_ME_GIFT_WRAPS)
					doTeleportThing(c, t.temple)
					doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
					local n1, n2 = getPlayerName(c), getPlayerName(cid)
					doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
					local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
					if #a < 2 then
						doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
						doPlayerAddLevel(a[1], 1)
						doTeleportThing(a[1], t.temple)
						doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
						reset()
						reset()
						return "endgame"
					end
				else
					local b = getTileItemById(_pos, t.blockID).uid
					if b > 0 then
						doSendMagicEffect(_pos, CONST_ME_BLOCKHIT)
						doRemoveItem(b)
						local r = math.random(10)
						if r < 4 then
							doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
						end
						return false
					end
				end
			elseif queryTileAddThing(v, _pos, 4) == 3 then
				return false
			end
			return true
		end
		while N <= l do
			local q = loopDir("N")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				N = N + 1
			end
		end
		while E <= l do
			local q = loopDir("E")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				E = E + 1
			end
		end
		while W <= l do
			local q = loopDir("W")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				W = W + 1
			end
		end
		while S <= l do
			local q = loopDir("S")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				S = S + 1
			end
		end
	end
	doRemoveItem(v, 1)
end
function onSay(cid, words, param, channel)
	if isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, math.max(getPlayerStorageValue(cid, t.storage.placed), 0))
		setPlayerStorageValue(cid, t.storage.max, math.max(getPlayerStorageValue(cid, t.storage.max), 1))
		setPlayerStorageValue(cid, t.storage.radius, math.max(getPlayerStorageValue(cid, t.storage.radius), 1))
		if getPlayerStorageValue(cid, t.storage.placed) < getPlayerStorageValue(cid, t.storage.max) then
			doCreateItem(t.bombID, 1, getThingPos(cid))
			addEvent(boom, t.delay, getThingPos(cid), cid)
			setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) + 1)
		end
		return true
	end
end
 
I get this now

Code:
[15:45:26.253] [Error - TalkAction Interface]
[15:45:26.256] In a timer event called from:
[15:45:26.257] data/talkactions/scripts/bomb.lua:onSay
[15:45:26.257] Description:
[15:45:26.258] (luaGetCreatureName) Creature not found

[15:45:26.258] [Error - TalkAction Interface]
[15:45:26.258] In a timer event called from:
[15:45:26.259] data/talkactions/scripts/bomb.lua:onSay
[15:45:26.259] Description:
[15:45:26.260] data/talkactions/scripts/bomb.lua:134: attempt to concatenate a boolean value
[15:45:26.260] stack traceback:
[15:45:26.260]  data/talkactions/scripts/bomb.lua:134: in function 'loopDir'
[15:45:26.260]  data/talkactions/scripts/bomb.lua:160: in function <data/talkactions/scripts/bomb.lua:87>
 
PHP:
function getPlayersInRange(position, radiusx, radiusy)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z})
				if creature.type == 1 then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if creature.type == 1 then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end

function isPositionInArray(haystack, needle)
	for i = 1, #haystack do
		if haystack[i].x == needle.x and haystack[i].y == needle.y and haystack[i].z == needle.z then
			return true
		end
	end
	return false
end

local t = {
	from = {x=490, y=495, z=9},
	to = {x=504, y=505, z=9},
	storage = {
		placed = 10001,
		max = 10002,
		radius = 10003
	},
	delay = 3000,
	bombID = 10570,
	effect = CONST_ME_FIREAREA,
	blockID = 9468,
	text = "BOOM!",
	temple = {x=498, y=541, z=9},
	exceptions = {
		{x=490, y=495, z=9},
		{x=491, y=495, z=9},
		{x=490, y=496, z=9},
		
		{x=503, y=495, z=9},
		{x=504, y=495, z=9},
		{x=504, y=496, z=9},
		
		{x=490, y=505, z=9},
		{x=491, y=505, z=9},
		{x=490, y=504, z=9},
		
		{x=503, y=505, z=9},
		{x=504, y=505, z=9},
		{x=504, y=504, z=9}
	}
}
function reset()
	local dummy = doCreateItem(10570, 1, {x=486,y=498,z=9})
	for x = t.from.x, t.to.x do
		for y = t.from.y, t.to.y do
			local pos = {x=x,y=y,z=t.from.z}
			local i1, i2, i3  = getTileItemById(pos, 8304).uid, getTileItemById(pos, 8306).uid, getTileItemById(pos, 8310).uid
			if i1 > 0 then
				doRemoveItem(i1)
			end
			if i2 > 0 then
				doRemoveItem(i2)
			end
			if i3 > 0 then
				doRemoveItem(i3)
			end
			if queryTileAddThing(dummy, pos, 4) == RETURNVALUE_NOERROR and not isPositionInArray(t.exceptions, pos) then
				doCreateItem(t.blockID, 1, pos)
			end
		end
	end
	doRemoveItem(dummy)
end

local function boom(pos, cid)
	local v = getTileItemById(pos, t.bombID).uid
	if isPlayer(cid) and isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) - 1)
		doCreatureSay(cid, t.text, TALKTYPE_ORANGE_2, false, nil, pos)
		doSendMagicEffect(pos, t.effect)
		local c = getTopCreature(pos).uid
		if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
			doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
			doTeleportThing(c, t.temple)
			doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
			local n1, n2 = getPlayerName(c), getPlayerName(cid)
			doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
			local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
			if #a < 2 then
				doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
				doPlayerAddLevel(a[1], 1)
				doTeleportThing(a[1], t.temple)
				doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
				reset()
				reset()
			end
		else
			local b = getTileItemById(pos, t.blockID).uid
			if b > 0 then
				doSendMagicEffect(pos, CONST_ME_BLOCKHIT)
				doRemoveItem(b)
				local r = math.random(10)
				if r < 4 then
					doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
				end
			end
		end
		local N, E, W, S, l = 1, 1, 1, 1, getPlayerStorageValue(cid, t.storage.radius)
		function loopDir(dir)
			local _pos = {x=pos.x+(dir=="E" and E or dir=="W" and -W or 0), y=pos.y+(dir=="N" and -N or dir=="S" and S or 0), z=pos.z}
			if queryTileAddThing(v, _pos, 4) == RETURNVALUE_NOERROR or getTileItemById(_pos, t.blockID).uid > 0 then
				doSendMagicEffect(_pos, t.effect)
				local c = getTopCreature(_pos).uid
				if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
					doSendMagicEffect(_pos, CONST_ME_GIFT_WRAPS)
					doTeleportThing(c, t.temple)
					doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
					local n1, n2 = getPlayerName(c), getPlayerName(cid)
					doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
					local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
					if #a < 2 then
						doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
						doPlayerAddLevel(a[1], 1)
						doTeleportThing(a[1], t.temple)
						doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
						reset()
						reset()
						return "endgame"
					end
				else
					local b = getTileItemById(_pos, t.blockID).uid
					if b > 0 then
						doSendMagicEffect(_pos, CONST_ME_BLOCKHIT)
						doRemoveItem(b)
						local r = math.random(10)
						if r < 4 then
							doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
						end
						return false
					end
				end
			elseif queryTileAddThing(v, _pos, 4) == 3 then
				return false
			end
			return true
		end
		while N <= l do
			local q = loopDir("N")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				N = N + 1
			end
		end
		while E <= l do
			local q = loopDir("E")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				E = E + 1
			end
		end
		while W <= l do
			local q = loopDir("W")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				W = W + 1
			end
		end
		while S <= l do
			local q = loopDir("S")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				S = S + 1
			end
		end
	end
	doRemoveItem(v, 1)
end
function onSay(cid, words, param, channel)
	if isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, math.max(getPlayerStorageValue(cid, t.storage.placed), 0))
		setPlayerStorageValue(cid, t.storage.max, math.max(getPlayerStorageValue(cid, t.storage.max), 1))
		setPlayerStorageValue(cid, t.storage.radius, math.max(getPlayerStorageValue(cid, t.storage.radius), 1))
		if getPlayerStorageValue(cid, t.storage.placed) < getPlayerStorageValue(cid, t.storage.max) then
			doCreateItem(t.bombID, 1, getThingPos(cid))
			addEvent(boom, t.delay, getThingPos(cid), cid)
			setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) + 1)
		end
		return true
	end
end
 
try this:
Code:
function getPlayersInRange(position, radiusx, radiusy)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z})
				if creature.type == 1 then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if creature.type == 1 then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end

function isPositionInArray(haystack, needle)
	for i = 1, #haystack do
		if haystack[i].x == needle.x and haystack[i].y == needle.y and haystack[i].z == needle.z then
			return true
		end
	end
	return false
end

local t = {
	from = {x=1306, y=1226, z=7},
	to = {x=1320, y=1236, z=7},
	storage = {
		placed = 10001,
		max = 10002,
		radius = 10003
	},
	delay = 3000,
	bombID = 10570,
	effect = CONST_ME_FIREAREA,
	blockID = 9421,
	text = "BOOM!",
	temple = {x=1218, y=1042, z=7},
	exceptions = {
		{x=1308, y=1227, z=7},
		{x=1307, y=1226, z=7},
		{x=1306, y=1227, z=7},
		
		{x=1320, y=1226, z=7},
		{x=1319, y=1226, z=7},
		{x=1320, y=1227, z=7},
		
		{x=1306, y=1236, z=7},
		{x=1306, y=1235, z=7},
		{x=1307, y=1236, z=7},
		
		{x=1320, y=1236, z=7},
		{x=1320, y=1235, z=7},
		{x=1319, y=1236, z=7}
	}
}
function reset()
	local dummy = doCreateItem(10570, 1, {x=1006,y=1098,z=12})
	for x = t.from.x, t.to.x do
		for y = t.from.y, t.to.y do
			local pos = {x=x,y=y,z=t.from.z}
			local i1, i2, i3  = getTileItemById(pos, 8304).uid, getTileItemById(pos, 8306).uid, getTileItemById(pos, 8310).uid
			if i1 > 0 then
				doRemoveItem(i1)
			end
			if i2 > 0 then
				doRemoveItem(i2)
			end
			if i3 > 0 then
				doRemoveItem(i3)
			end
			if queryTileAddThing(dummy, pos, 4) == RETURNVALUE_NOERROR and not isPositionInArray(t.exceptions, pos) then
				doCreateItem(t.blockID, 1, pos)
			end
		end
	end
	doRemoveItem(dummy)
end

local function boom(pos, cid)
	local v = getTileItemById(pos, t.bombID).uid
	if isPlayer(cid) and isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) - 1)
		doCreatureSay(cid, t.text, TALKTYPE_ORANGE_2, false, nil, pos)
		doSendMagicEffect(pos, t.effect)
		local c = getTopCreature(pos).uid
		if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
			doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
			doTeleportThing(c, t.temple)
			doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
			local n1, n2 = getPlayerName(c), getPlayerName(cid)
			doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
			local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
			if #a < 2 and #a > 0 then
				doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
				doPlayerAddLevel(a[1], 1)
				doTeleportThing(a[1], t.temple)
				doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
				reset()
				reset()
			end
		else
			local b = getTileItemById(pos, t.blockID).uid
			if b > 0 then
				doSendMagicEffect(pos, CONST_ME_BLOCKHIT)
				doRemoveItem(b)
				local r = math.random(10)
				if r < 4 then
					doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
				end
			end
		end
		local N, E, W, S, l = 1, 1, 1, 1, getPlayerStorageValue(cid, t.storage.radius)
		function loopDir(dir)
			local _pos = {x=pos.x+(dir=="E" and E or dir=="W" and -W or 0), y=pos.y+(dir=="N" and -N or dir=="S" and S or 0), z=pos.z}
			if queryTileAddThing(v, _pos, 4) == RETURNVALUE_NOERROR or getTileItemById(_pos, t.blockID).uid > 0 then
				doSendMagicEffect(_pos, t.effect)
				local c = getTopCreature(_pos).uid
				if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
					doSendMagicEffect(_pos, CONST_ME_GIFT_WRAPS)
					doTeleportThing(c, t.temple)
					doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
					local n1, n2 = getPlayerName(c), getPlayerName(cid)
					doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
					local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
					if #a < 2 then
						doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
						doPlayerAddLevel(a[1], 1)
						doTeleportThing(a[1], t.temple)
						doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
						reset()
						reset()
						return "endgame"
					end
				else
					local b = getTileItemById(_pos, t.blockID).uid
					if b > 0 then
						doSendMagicEffect(_pos, CONST_ME_BLOCKHIT)
						doRemoveItem(b)
						local r = math.random(10)
						if r < 4 then
							doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
						end
						return false
					end
				end
			elseif queryTileAddThing(v, _pos, 4) == 3 then
				return false
			end
			return true
		end
		while N <= l do
			local q = loopDir("N")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				N = N + 1
			end
		end
		while E <= l do
			local q = loopDir("E")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				E = E + 1
			end
		end
		while W <= l do
			local q = loopDir("W")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				W = W + 1
			end
		end
		while S <= l do
			local q = loopDir("S")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				S = S + 1
			end
		end
	end
	doRemoveItem(v, 1)
end
function onSay(cid, words, param, channel)
	if isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, math.max(getPlayerStorageValue(cid, t.storage.placed), 0))
		setPlayerStorageValue(cid, t.storage.max, math.max(getPlayerStorageValue(cid, t.storage.max), 1))
		setPlayerStorageValue(cid, t.storage.radius, math.max(getPlayerStorageValue(cid, t.storage.radius), 1))
		if getPlayerStorageValue(cid, t.storage.placed) < getPlayerStorageValue(cid, t.storage.max) then
			doCreateItem(t.bombID, 1, getThingPos(cid))
			addEvent(boom, t.delay, getThingPos(cid), cid)
			setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) + 1)
		end
		return true
	end
end
 
@fallen

Code:
[16:51:34.210] [Error - TalkAction Interface]
[16:51:34.210] In a timer event called from:
[16:51:34.210] data/talkactions/scripts/bomb.lua:onSay
[16:51:34.211] Description:
[16:51:34.211] (luaGetCreatureName) Creature not found

[16:51:34.211] [Error - TalkAction Interface]
[16:51:34.211] In a timer event called from:
[16:51:34.212] data/talkactions/scripts/bomb.lua:onSay
[16:51:34.212] Description:
[16:51:34.213] data/talkactions/scripts/bomb.lua:134: attempt to concatenate a boolean value
[16:51:34.213] stack traceback:
[16:51:34.214]  data/talkactions/scripts/bomb.lua:134: in function 'loopDir'
[16:51:34.214]  data/talkactions/scripts/bomb.lua:170: in function <data/talkactions/scripts/bomb.lua:87>
 
>>870424
Why is everyone all of a sudden requesting for help in the Bomberman script?

Anyways, try this...
Lua:
function getPlayersInRange(position, radiusx, radiusy)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				local creature = getThingFromPos({x = position.x + x, y = position.y + y, z = position.z, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
				if(creature.type == 1 and creature.uid ~= 0) then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if(creature.type == 1 and creature.uid ~= 0) then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end

function isPositionInArray(haystack, needle)
	for i = 1, #haystack do
		if haystack[i].x == needle.x and haystack[i].y == needle.y and haystack[i].z == needle.z then
			return true
		end
	end
	return false
end

local t = {
	from = {x=1306, y=1226, z=7},
	to = {x=1320, y=1236, z=7},
	storage = {
		placed = 10001,
		max = 10002,
		radius = 10003
	},
	delay = 3000,
	bombID = 10570,
	effect = CONST_ME_FIREAREA,
	blockID = 9421,
	text = "BOOM!",
	temple = {x=1218, y=1042, z=7},
	exceptions = {
		{x=1308, y=1227, z=7},
		{x=1307, y=1226, z=7},
		{x=1306, y=1227, z=7},
		
		{x=1320, y=1226, z=7},
		{x=1319, y=1226, z=7},
		{x=1320, y=1227, z=7},
		
		{x=1306, y=1236, z=7},
		{x=1306, y=1235, z=7},
		{x=1307, y=1236, z=7},
		
		{x=1320, y=1236, z=7},
		{x=1320, y=1235, z=7},
		{x=1319, y=1236, z=7}
	}
}
function reset()
	local dummy = doCreateItem(10570, 1, {x=1006,y=1098,z=12})
	for x = t.from.x, t.to.x do
		for y = t.from.y, t.to.y do
			local pos = {x=x,y=y,z=t.from.z}
			local i1, i2, i3  = getTileItemById(pos, 8304).uid, getTileItemById(pos, 8306).uid, getTileItemById(pos, 8310).uid
			if i1 > 0 then
				doRemoveItem(i1)
			end
			if i2 > 0 then
				doRemoveItem(i2)
			end
			if i3 > 0 then
				doRemoveItem(i3)
			end
			if queryTileAddThing(dummy, pos, 4) == RETURNVALUE_NOERROR and not isPositionInArray(t.exceptions, pos) then
				doCreateItem(t.blockID, 1, pos)
			end
		end
	end
	doRemoveItem(dummy)
end

local function boom(pos, cid)
	local v = getTileItemById(pos, t.bombID).uid
	if isPlayer(cid) and isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) - 1)
		doCreatureSay(cid, t.text, TALKTYPE_ORANGE_2, false, nil, pos)
		doSendMagicEffect(pos, t.effect)
		local c = getTopCreature(pos).uid
		if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
			doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
			doTeleportThing(c, t.temple)
			doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
			local n1, n2 = getPlayerName(c), getPlayerName(cid)
			doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
			local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
			if #a < 2 then
				doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
				doPlayerAddLevel(a[1], 1)
				doTeleportThing(a[1], t.temple)
				doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
				reset()
				reset()
			end
		else
			local b = getTileItemById(pos, t.blockID).uid
			if b > 0 then
				doSendMagicEffect(pos, CONST_ME_BLOCKHIT)
				doRemoveItem(b)
				local r = math.random(10)
				if r < 4 then
					doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
				end
			end
		end
		local N, E, W, S, l = 1, 1, 1, 1, getPlayerStorageValue(cid, t.storage.radius)
		function loopDir(dir)
			local _pos = {x=pos.x+(dir=="E" and E or dir=="W" and -W or 0), y=pos.y+(dir=="N" and -N or dir=="S" and S or 0), z=pos.z}
			if queryTileAddThing(v, _pos, 4) == RETURNVALUE_NOERROR or getTileItemById(_pos, t.blockID).uid > 0 then
				doSendMagicEffect(_pos, t.effect)
				local c = getTopCreature(_pos).uid
				if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
					doSendMagicEffect(_pos, CONST_ME_GIFT_WRAPS)
					doTeleportThing(c, t.temple)
					doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
					local n1, n2 = getPlayerName(c), getPlayerName(cid)
					doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
					local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
					if #a < 2 then
						doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
						doPlayerAddLevel(a[1], 1)
						doTeleportThing(a[1], t.temple)
						doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
						reset()
						reset()
						return "endgame"
					end
				else
					local b = getTileItemById(_pos, t.blockID).uid
					if b > 0 then
						doSendMagicEffect(_pos, CONST_ME_BLOCKHIT)
						doRemoveItem(b)
						local r = math.random(10)
						if r < 4 then
							doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
						end
						return false
					end
				end
			elseif queryTileAddThing(v, _pos, 4) == 3 then
				return false
			end
			return true
		end
		while N <= l do
			local q = loopDir("N")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				N = N + 1
			end
		end
		while E <= l do
			local q = loopDir("E")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				E = E + 1
			end
		end
		while W <= l do
			local q = loopDir("W")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				W = W + 1
			end
		end
		while S <= l do
			local q = loopDir("S")
			if q == "endgame" then
				return doRemoveItem(v, 1)
			elseif not q then
				break
			else
				S = S + 1
			end
		end
	end
	doRemoveItem(v, 1)
end

function onSay(cid, words, param, channel)
	if isInRange(getThingPos(cid), t.from, t.to) then
		setPlayerStorageValue(cid, t.storage.placed, math.max(getPlayerStorageValue(cid, t.storage.placed), 0))
		setPlayerStorageValue(cid, t.storage.max, math.max(getPlayerStorageValue(cid, t.storage.max), 1))
		setPlayerStorageValue(cid, t.storage.radius, math.max(getPlayerStorageValue(cid, t.storage.radius), 1))
		if getPlayerStorageValue(cid, t.storage.placed) < getPlayerStorageValue(cid, t.storage.max) then
			doCreateItem(t.bombID, 1, getThingPos(cid))
			addEvent(boom, t.delay, getThingPos(cid), cid)
			setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) + 1)
		end
		return true
	end
end
 
@ratser dont know:OOO

Code:
[19:51:02.121] [Error - TalkAction Interface]
[19:51:02.121] In a timer event called from:
[19:51:02.122] data/talkactions/scripts/bomb.lua:onSay
[19:51:02.122] Description:
[19:51:02.122] data/talkactions/scripts/bomb.lua:134: attempt to concatenate a boolean value
[19:51:02.123] stack traceback:
[19:51:02.123]  data/talkactions/scripts/bomb.lua:134: in function 'loopDir'
[19:51:02.123]  data/talkactions/scripts/bomb.lua:160: in function <data/talkactions/scripts/bomb.lua:87>
 
Lua:
local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5)
change that position to the center of the room, and change 7 and 5 (X and Y radii) if needed
bomberman v2 eliminates the possibility of messing up here by using a more intelligent and newbie-proof method
 
It was the pos... But how can i fix this?

Code:
[21:42:55.004] [Error - TalkAction Interface]
[21:42:55.005] In a timer event called from:
[21:42:55.005] data/talkactions/scripts/bomb.lua:onSay
[21:42:55.005] Description:
[21:42:55.005] (luaDoRemoveItem) Item not found
 
Back
Top