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

Azerus tp won't disappear

Thunder Beam

New Member
Joined
Apr 23, 2008
Messages
107
Reaction score
0
Hello,

I have some problems with my Azerus, I'll explain it:

When you killed Azerus there has to appear a Teleporter, that works fine but now, it has to DISappear after 2 min's but that won't work, who can help me?

This is the script:

function onKill(cid, target)
if (getCreatureName(target) == "Azerus") then
local teleport = doCreateTeleport(1387, {x=1661,y=1508,z=12}, {x=1730,y=1608,z=10}) -- tworzenie teleportu
local x = {tp = teleport}
addEvent(usun,2*60*1000,x)
end
return TRUE
end


function usun(x)
doRemoveItem(getThingfromPos(corpse).uid, 1)
end

And this is the error in my console (2 mins after killing Azerus):

[25/04/2009 17:13:24] Lua Script Error: [CreatureScript Interface]
[25/04/2009 17:13:24] in a timer event called from:
[25/04/2009 17:13:24] data/creaturescripts/scripts/azerushunt.lua:eek:nKill

[25/04/2009 17:13:24] attempt to index a nil value
[25/04/2009 17:13:24] stack traceback:
[25/04/2009 17:13:24] [C]: in function 'getThingfromPos'
[25/04/2009 17:13:24] data/creaturescripts/scripts/azerushunt.lua:12: in function <data/creaturescripts/scripts/azerushunt.lua:11>

please help me ! :)
 
Code:
				function onKill(cid, target)
	if getCreatureName(target) == "Azerus" then
 local teleport = doCreateTeleport(1387, {x=1661,y=1508,z=12}, {x=1730,y=1608,z=10})
 local x = {tp = teleport}
	   addEvent(usun, 2*60*1000, x)
 end
 return TRUE
end

				function usun(x)
	   doRemoveItem(getThingfromPos(corpse).uid, 1)
 return TRUE
end
 
Thanks, gonna test it right now :)

EDIT:

hmm, same error:

[25/04/2009 19:24:20] Lua Script Error: [CreatureScript Interface]
[25/04/2009 19:24:20] in a timer event called from:
[25/04/2009 19:24:20] data/creaturescripts/scripts/azerushunt.lua:eek:nKill

[25/04/2009 19:24:20] attempt to index a nil value
[25/04/2009 19:24:20] stack traceback:
[25/04/2009 19:24:20] [C]: in function 'getThingfromPos'
[25/04/2009 19:24:20] data/creaturescripts/scripts/azerushunt.lua:11: in function <data/creaturescripts/scripts/azerushunt.lua:10>
 
Last edited:
Code:
local config = {
	message = "Now You have 2 minutes to come in the teleport on the north room",
	timeToRemove = 120, -- seconds
	teleportId = 1387,
	bosses = { -- Monster Name, Teleport To Position, Teleport Position
		["Azerus"] = { { x = 35163, y = 31944, z = 7 }, { x = 35168, y = 31897, z = 10, stackpos = 1 } },

	}
}

local function removal(position)
	if getThingfromPos(position).itemid == config.teleportId then
		doRemoveItem(getThingfromPos(position).uid)
	end
	return TRUE
end

function onDeath(cid, corpse, killer)
	local position = getCreaturePosition(cid)
	for name, pos in pairs(config.bosses) do
		if name == getCreatureName(cid) then
			teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
			doSendMagicEffect(pos[2], CONST_ME_TELEPORT)
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
			addEvent(removal, config.timeToRemove * 1000, pos[2])
		end
	end
	return TRUE
end

Repp ++ :)
 

Similar threads

Back
Top