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

Remove teleport from dead monster position [TFS 0.3.6]

waqmaz

Member
Joined
Jun 17, 2015
Messages
203
Reaction score
11
Code:
        doCreateTeleport(1387, tp_pos, getCreaturePosition(target))
        addEvent(doRemoveItem, 5 * 1000, getTileItemById(getCreaturePosition(target), 1387).uid, 1)
This script creates teleport on a location of dead monster. All is inside onKill function.
How to remove the teleport?
Also the teleport is created under a monster's corpse, Is it possible to make the corpse being under the teleport?
If the corpse has id 5200 how to remove a corpse? - will solve the problem with the teleprot under it.
Thanks!
 
Hey there. I've watched around 25+ topics about monsters and tp, but I cannot find anything about removing teleport from position of monster's corpse.

It will help a little. How to find dead monster position?
Code:
local function removal(monsters_corpse_position)
    doRemoveThing(getTileItemById(monsters_corpse_position, 1387).uid, 1)
    return TRUE
end
 
Hey there. I've watched around 25+ topics about monsters and tp, but I cannot find anything about removing teleport from position of monster's corpse.

It will help a little. How to find dead monster position?
Code:
local function removal(monsters_corpse_position)
    doRemoveThing(getTileItemById(monsters_corpse_position, 1387).uid, 1)
    return TRUE
end
You already have the remove function right here..
Code:
addEvent(doCreateTeleport, 50, 1387, tp_pos, getCreaturePosition(target))
addEvent(doRemoveItem, 5 * 1000, getTileItemById(getCreaturePosition(target), 1387).uid, 1)
Am I not understanding what you want?

Put teleport on top of body,
remove teleport after 5 second.
 
Code:
 Put teleport on top of body,
remove teleport after 5 second.
It should work that way, but isn't.
Are You sure this is correct for 0.3.6?
Code:
addEvent(doRemoveItem, 5 * 1000, getTileItemById(getCreaturePosition(target), 1387).uid, 1)
I've tried with getthingfrompos like
Code:
addEvent(doRemoveItem, 5 * 1000, getThingfromPos(getCreaturePosition(target)).uid, 1) --, 1387
and still doesn't work.
A teleport still appears under a dead body and it doesn't remove.
 
Last edited:
Well, I suppose this is a boss, in this case you could set the decaycorpse in items.xml to 0, this way the monster will vanish and the teleport will stay on top.

I know, not a pretty solution, but it'd work.
 
you could set the decaycorpse in items.xml to 0,
I dont understand. Lets say we have an item:
Code:
<item id="666" name="decay corpse"></item>
What should be the parameter inside?

I suppose this is a boss
Ofcourse.

/edit It is probably
<attribute key="decayTo" value="0" />
Will check it.
 
Last edited:
But the teleport still isnt removed. I will try function createItem instead of createTeleport, will script that item to be a teleport in lua and then i'll try to remove the item

Still does not work.
 
Last edited:
Code:
 Put teleport on top of body,
remove teleport after 5 second.
Are You sure this is correct for 0.3.6?
Are you sure.. smh
All I do is work with 0.3.6
Code:
function onKill(cid, target, damage, flags)
target = monster/player (whoever died
)
So you use target to find position.
Code:
doRemoveItem(getTileItemById(getThingPos(target), 3758).uid)
-- this remove it right away
-- so we turn it into an addEvent to remove after 5 seconds.
addEvent(function, time, parameters)
addEvent(doRemoveItem, 5000, getTileItemById(getThingPos(getNpcId()), 3758).uid)
same with teleport, so the body is created, then teleport created on the position.
Code:
addEvent(doCreateTeleport, 50, 1387, tp_pos, getCreaturePosition(target))
 
Back
Top