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

Yalahar remove tp.

enriel

Big L
Joined
Dec 14, 2007
Messages
1,254
Reaction score
2
Location
Montenegro
Why isn't this script removing the teleport after 2 mins? Is it possible to make??

local config = {
message = "Azerus ran into teleporter! It will disappear in 2 minutes. Enter It!",
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["Azerus"] = { { x = 2881, y = 2179, z = 9 }, { x = 2881, y = 2175, z = 10 }},



}
}


function onDeath(cid, corpse, killer)
local position = getCreaturePosition(cid)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(cid) then

doCreateTeleport(config.teleportId, pos[1], pos[2])
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
end
end
return TRUE
end
 
Isnt deleting cause you even dont have deleting function in that script
I was struggling to make inq working 100% but in 0.3.5 it was unable to delete portal with action/unique id I guess.
Here you only have to use other tp(other id than every used on map) and set it decaying in items.xml
 
Code:
local event = 0
local cfg = {
	teleportTo = {x=2881, y=2179, z=9},
	teleportCreatePos = {x=2881, y=2175, z=10}
}
local function remTp(pos)
	local v = getTileItemById(pos, 1387).uid
	return v > 0 and doRemoveItem(v)
end
function onDeath(cid, corpse, killer)
	if getCreatureName(cid) == "Azerus" then
		stopEvent(event)
		doCreateTeleport(1387, cfg.teleportTo, cfg.teleportCreatePos)
		event = addEvent(remTp, 2 * 60 * 1000, cfg.teleportCreatePos)
		doCreatureSay(cid, "Azerus ran into teleporter! It will disappear in 2 minutes. Enter It!", TALKTYPE_ORANGE_1)
	end
	return TRUE
end
Isnt deleting cause you even dont have deleting function in that script
I was struggling to make inq working 100% but in 0.3.5 it was unable to delete portal with action/unique id I guess.
Here you only have to use other tp(other id than every used on map) and set it decaying in items.xml
He would need to make a movement script for that teleporter because it isn't ITEM_TYPE_TELEPORT by default.
 
I tried it but:

22:57 You see an item of type 9738, please report it to gamemaster.
ItemID: [9738].
Position: [X: 1136] [Y: 1149] [Z: 10].

It's creating wrong teleport and it doesn't decay? :eek:
 
I tried it but:

22:57 You see an item of type 9738, please report it to gamemaster.
ItemID: [9738].
Position: [X: 1136] [Y: 1149] [Z: 10].

It's creating wrong teleport and it doesn't decay? :eek:
lol, use my script & tp with id 1387
 
@up, Yeah I'm doing it.. look:
local event = 0
local cfg = {
teleportTo = {x=1141, y=1160, z=9},
teleportCreatePos = {x=1141, y=1157, z=10}
}
local function remTp(pos)
local v = getTileItemById(pos, 1387).uid
return v > 0 and doRemoveItem(v)
end
function onDeath(cid, corpse, killer)
if getCreatureName(cid) == "Azerus" then
stopEvent(event)
doCreateTeleport(1387, cfg.teleportTo, cfg.teleportCreatePos)
event = addEvent(remTp, 2 * 60 * 1000, cfg.teleportCreatePos)
doCreatureSay(cid, "Azerus ran into teleporter! It will disappear in 2 minutes. Enter It!", TALKTYPE_ORANGE_1)
end
return TRUE
end

and when creature dies, and when creature dies teleport is created but doesn't remove..
00:47 You see an item of type 9738, please report it to gamemaster.
 
ehm, well I have like this in monster:

<script>
<event name="Azerus"/>
</script>

under flags.

and in creature-script XML I've got:
<event type="death" name="Azerus" event="script" value="azerus.lua"/>

still when Azerus dies, just animated text is shown, no tp is created.
this is with corpse id 0.
if i use regular corpse id, then it create TP but don't disappear.
 
Last edited:
Back
Top Bottom