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

Lua TP Spawns when monster killed.

Wifebeater

New Member
Joined
Feb 24, 2011
Messages
60
Reaction score
1
Hi , I've looked everywere without any results. Where do i find an action script were a teleport spawns when a monster dies? :S
 
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
		["monstername"] = { { 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
 
hey iam sorry where i put this script and it works in .xml 8.1 or not
when i used it i get this error
:: Loading movements.xml...Warning: [Event::loadScript] Event onStepIn not found. data/movements/scripts/Zeus tp.lua ????
 
Back
Top