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

Lua Solve this for me?

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
I have tried to solve this problem for a long time, but i dont get the support i need.
I changed something in my script that cykotitan gave me, but now i got this error instead.
Please solve this for me :(!

loolv.jpg


OLD SCRIPT (not working)

Code:
local TilePos = {x=1005, y=1002, z=7, stackpos = 2}
 
local config = {
	arena = {
		frompos = {x = 1131, y = 913, z =7},
		topos = {x = 1161, y = 930, z=7}
	}
}
 
 
function onThink(interval)
doBroadcastMessage("Deadly Spider event will start after 15 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
addEvent(BC2, 15 * 60 * 1000)
	return true
end
 
function onThink(interval, lastExecution)
doBroadcastMessage("Deadly Spider event will start after 10 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
addEvent(BC3, 10 * 60 * 1000)
	return true
end
 
function BC3()
doBroadcastMessage("Deadly Spider event will start after 5 minutes! The teleport to arena is located in temple. You can\'t enter arena during the event, so hurry up and don\'t be late!", MESSAGE_EVENT_ADVANCE)
addEvent(Spawn, 5 * 60 * 1000)
addEvent(BC4, 5 * 60 * 1000)
	return true
end
 
function BC4()
doItemSetAttribute(getTileItemById({x=1005, y=1002, z=7, stackpos = 2}).uid, "aid", 7796)
doBroadcastMessage("The event started and Deadly Spiders are being summoned. Winner is the player who dies last. Good luck!", MESSAGE_EVENT_ADVANCE)
doSendMagicEffect({x=1005, y=1002, z=7}, 6)
	return true
end
 
function Spawn()
	if #getPlayersfromArea(config.arena.frompos, config.arena.topos) < 1 then
		local monsters = getMonstersfromArea(config.arena.frompos, config.arena.topos)
		doItemSetAttribute(getTileItemById({x=1005, y=1002, z=7, stackpos = 2}).uid, "aid", 7795)
		for _, monster in ipairs(monsters) do
			doRemoveCreature(monster)
		end
	else
		addEvent(Spawn, 20 * 1000)
		doSummonCreature("Deadly Zombie", {x = 1145, y = 922, z=7})
		doSendMagicEffect({x = 1145, y = 922, z=7}, 10)
	end
	return true
end

NEW SCRIPT (not working)

Code:
local TilePos = {x=1005, y=1002, z=7, stackpos = 2}
 
local config = {
	arena = {
		frompos = {x = 1131, y = 913, z =7},
		topos = {x = 1161, y = 930, z=7}
	}
}
 
 
function onThink(interval)
doBroadcastMessage("Deadly Spider event will start after 15 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
addEvent(BC2, 15 * 60 * 1000)
	return true
end
 
function onThink(interval, lastExecution)
doBroadcastMessage("Deadly Spider event will start after 10 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
addEvent(BC3, 10 * 60 * 1000)
	return true
end
 
function BC3()
doBroadcastMessage("Deadly Spider event will start after 5 minutes! The teleport to arena is located in temple. You can\'t enter arena during the event, so hurry up and don\'t be late!", MESSAGE_EVENT_ADVANCE)
addEvent(Spawn, 5 * 60 * 1000)
addEvent(BC4, 5 * 60 * 1000)
	return true
end
 
function BC4()
doItemSetAttribute(getTileItemById({x=1005, y=1002, z=7, stackpos = 2}).uid, "aid", 7796)
doBroadcastMessage("The event started and Deadly Spiders are being summoned. Winner is the player who dies last. Good luck!", MESSAGE_EVENT_ADVANCE)
doSendMagicEffect({x=1005, y=1002, z=7}, 6)
	return true
end
 
function getPlayersfromArea(f, t)
	local a = {}
	for x = f.x, t.x do for y = f.y, t.y do for z = f.z, t.z do
		local v = getTopCreature({x=x, y=y, z=z}).uid
		if v ~= 0 and isPlayer(v) then
			table.insert(a, v)
		end
	end end end
	return
end

REP FOR YOU GUYS! ^_^
 
LUA:
local TilePos = {x=1005, y=1002, z=7}
local spawn = {x=1145, y=922, z=7}

local from = {x = 1131, y = 913, z =7}
local to = {x = 1161, y = 930, z=7}

function onThink(interval)
	doBroadcastMessage('Deadly Spider event will start after 15 minutes! The teleport to arena is located in temple.', MESSAGE_EVENT_ADVANCE)
	addEvent(BC2, 15 * 60 * 1000)
	return true
end

function BC2()
	doBroadcastMessage('Deadly Spider event will start after 10 minutes! The teleport to arena is located in temple.', MESSAGE_EVENT_ADVANCE)
	addEvent(BC3, 10 * 60 * 1000)
end

function BC3()
	doBroadcastMessage('Deadly Spider event will start after 5 minutes! The teleport to arena is located in temple. You can\'t enter arena during the event, so hurry up and don\'t be late!', MESSAGE_EVENT_ADVANCE)
	addEvent(BC4, 5 * 60 * 1000)
end

function BC4()
	doItemSetAttribute(getTileItemById(TilePos, 1387).uid, 'aid', 7796)
	doBroadcastMessage('The event started and Deadly Spiders are being summoned. Winner is the player who dies last. Good luck!', MESSAGE_EVENT_ADVANCE)
	doSendMagicEffect(TilePos, 6)
	Spawn()
end

function Spawn()
	for x = from.x, to.x do
		for y = from.y, to.y do
			local a = getTopCreature({x=x, y=y, z=7}).uid
			if a ~= 0 and isPlayer(a) then
				addEvent(Spawn, 20 * 1000)
				doCreateMonster('Deadly Spider', spawn)
				doSendMagicEffect(spawn, CONST_ME_TELEPORT)
				return
			end
		end
	end
	doItemSetAttribute(getTileItemById(TilePos, 1387).uid, 'aid', 7795)
	for _, f in ipairs(getMonstersfromArea(from, to)) do
		doRemoveCreature(f)
	end
end
so is it spiders or zombies?
 
it's not about the server anymore, this is compatible with 0.3.6 too. nothing 0.4-specific inside it

yeah, but he's using a private version of TFS and getting errors on it, he should solve them himself or use free versions of TFS.
its like if you steal a computer, and it got an error and you go to the store where you stole it from, and tell them to fix it because all of the computers have the same error, but the guy from the store knows that you stole it, what would he do? fix it? no, he probably would call the cops or something like that.
 
Back
Top