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

Zombie onThink

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Hello, i have a problem with my Zombie event. :(

The console gives an error of this: Event onThink not found <data/globalevents/scripts/zombieevent.lua>

im using TFS 0.4

This is the script:

Code:
local TilePos = {x=1005, y=1002, z=7, stackpos = 2}

local config = {
	arena = {
		frompos = {x = 1130, y = 912, z = 7},
		topos = {x = 1162, y = 931, z = 7}
	}
}


--function onThink(interval)
--doBroadcastMessage("Deadly Zombie event will start after 15 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
--addEvent(BC2, 5 * 60 * 1000)
--end

function onTime(interval, lastExecution)
doBroadcastMessage("Zombie event will start after 10 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
addEvent(BC3, 5 * 60 * 1000)
end

function BC3()
doBroadcastMessage("Zombie 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)
end

function BC4()
doItemSetAttribute(getThingFromPos(TilePos).uid, "aid", 7796)
doBroadcastMessage("The event started and Zombies are being summoned. Winner is the player who dies last. Good luck!", MESSAGE_EVENT_ADVANCE)
doSendMagicEffect({x=1005, y=1002, z=7}, 6)
end

function Spawn()
	if #getPlayersfromArea(config.arena.frompos, config.arena.topos) < 1 then
		local monsters = getMonstersfromArea(config.arena.frompos, config.arena.topos)
		doItemSetAttribute(getThingFromPos(TilePos).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
'

Please help! :$

REP++
 
remove the -- from onthink function.. its saying that one is not found cause its set to not be read.

LUA:
local TilePos = {x=1005, y=1002, z=7, stackpos = 2}

local config = {
	arena = {
		frompos = {x = 1130, y = 912, z = 7},
		topos = {x = 1162, y = 931, z = 7}
	}
}


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

function onTime(interval, lastExecution)
doBroadcastMessage("Zombie event will start after 10 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
addEvent(BC3, 5 * 60 * 1000)
end

function BC3()
doBroadcastMessage("Zombie 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)
end

function BC4()
doItemSetAttribute(getThingFromPos(TilePos).uid, "aid", 7796)
doBroadcastMessage("The event started and Zombies are being summoned. Winner is the player who dies last. Good luck!", MESSAGE_EVENT_ADVANCE)
doSendMagicEffect({x=1005, y=1002, z=7}, 6)
end

function Spawn()
	if #getPlayersfromArea(config.arena.frompos, config.arena.topos) < 1 then
		local monsters = getMonstersfromArea(config.arena.frompos, config.arena.topos)
		doItemSetAttribute(getThingFromPos(TilePos).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
 
remove the -- from onthink function.. its saying that one is not found cause its set to not be read.

LUA:
local TilePos = {x=1005, y=1002, z=7, stackpos = 2}


Still same :(

local config = {
	arena = {
		frompos = {x = 1130, y = 912, z = 7},
		topos = {x = 1162, y = 931, z = 7}
	}
}


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

function onTime(interval, lastExecution)
doBroadcastMessage("Zombie event will start after 10 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
addEvent(BC3, 5 * 60 * 1000)
end

function BC3()
doBroadcastMessage("Zombie 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)
end

function BC4()
doItemSetAttribute(getThingFromPos(TilePos).uid, "aid", 7796)
doBroadcastMessage("The event started and Zombies are being summoned. Winner is the player who dies last. Good luck!", MESSAGE_EVENT_ADVANCE)
doSendMagicEffect({x=1005, y=1002, z=7}, 6)
end

function Spawn()
	if #getPlayersfromArea(config.arena.frompos, config.arena.topos) < 1 then
		local monsters = getMonstersfromArea(config.arena.frompos, config.arena.topos)
		doItemSetAttribute(getThingFromPos(TilePos).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


Still same problem :(
 
LUA:
local tilePos = {x=1005, y=1002, z=7, stackpos = 2}
 
local config = {
	arena = {
		frompos = {x = 1130, y = 912, z = 7},
		topos = {x = 1162, y = 931, z = 7}
	}
}
 
 
function onThink(interval, lastExecution)
	doBroadcastMessage("Deadly Zombie event will start after 15 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
	addEvent(BC2, 5 * 60 * 1000)
	
	return true
end
 
function BC2()
	doBroadcastMessage("Zombie event will start after 10 minutes! The teleport to arena is located in temple.", MESSAGE_EVENT_ADVANCE)
	addEvent(BC3, 5 * 60 * 1000)
end
 
function BC3()
	doBroadcastMessage("Zombie 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)
end
 
function BC4()
	doItemSetAttribute(getThingFromPos(tilePos).uid, "aid", 7796)
	doBroadcastMessage("The event started and Zombies are being summoned. Winner is the player who dies last. Good luck!", MESSAGE_EVENT_ADVANCE)
	doSendMagicEffect({x=1005, y=1002, z=7}, 6)
end
 
function Spawn()
	if #getPlayersfromArea(config.arena.frompos, config.arena.topos) < 1 then
		local monsters = getMonstersfromArea(config.arena.frompos, config.arena.topos)
		doItemSetAttribute(getThingFromPos(tilePos).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
end
 
Back
Top