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

Solved Function onKill create item on corpse pos

Shackal

Alien Project
Joined
Feb 7, 2009
Messages
211
Reaction score
17
Location
Brazil
Hello guys,

How i can to make this script create item on corpose pos?

I'm using TFS 0.3.7

Ty u in advance!

Code:
local config = {
        timeToRemove = 90, -- seconds
        teleportId = 12278,
        bosses = { -- Monster Name,  Teleport Position
                ["Wrath of the Emperor"] = {  pos = {x = 1515, y = 917, z = 7}, aid = 55555 }
        }
}
local function removal(position)
    doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
    return TRUE
end

function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
        local t = config.bosses[getCreatureName(target)]
       local teleport = doCreateItem(config.teleportId, cid)
        local position = t.pos
        doItemSetAttribute(teleport, "aid", t.aid)
        addEvent(removal, config.timeToRemove * 1000, position)
    end
    return true
end
 
sorry, i solve it.

Code:
local config = {
        timeToRemove = 90, -- seconds
        teleportId = 12278,
        bosses = { -- Monster Name,  Teleport Position
                ["Wrath of the Emperor"] = {  pos = {x = 1515, y = 917, z = 7}, aid = 55555 }
        }
}
local function removal(position)
    doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
    return TRUE
end

function onDeath(cid, corpse, killer)
local creaturename = getCreatureName(cid)
if creaturename == 'Wrath of the Emperor' and isPlayer(cid) == FALSE then
       
        local t = config.bosses[getCreatureName(cid)]
        local teleport = doCreateItem(config.teleportId, getThingPos(cid))
        local position = t.pos
        doItemSetAttribute(teleport, "aid", t.aid)
        addEvent(removal, config.timeToRemove * 1000, position)
    end
    return true
end
 
Back
Top